You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Peter Murphy <pe...@fast.fujitsu.com.au> on 2001/11/07 07:33:50 UTC

The Xalan test suite

All,

I've attempted to compile and run the projects with the latest build of
xml-xalan\c\Tests\Test.dsw. All now compile. Unfortunately, with the
exception of ThreadTest.dsp, none of them seem to work. And with the
exception of Transformer.dsp (which uses absolute path file names in its
code - path names that don't correspond to those in my machine), they fail
in EXACTLY the same way. Here's what seems to be happening...

Most of the programs take several command line arguments. One argument is
mandatory: the base directory for test cases. If no arguments are provided,
you get a display like this:

-------------------------------------------------------
Using Xerces Version 1_5_2

conf dirname [-category -out -gold]

dirname         (base directory for testcases)
-category dirname (specific directory)
-out dirname    (base directory for output)
-gold dirname   (base directory for gold files)
Press any key to continue
--------------------------------------------------------

Since my conf test files appear to be in
"C:\TempXalanAndXerces\xml-xalan\test\tests\conf", I ran
"conf C:\TempXalanAndXerces\xml-xalan\test\tests\conf". I got the following
message:

--------------------------------------------------------------
Given base directory "C:\TempXalanAndXerces\xml-xalan\test\tests\conf" does
not
exist
--------------------------------------------------------------

Stepping through the code, I noticed that main called a getParams routine to
evaluate the command line arguments:

---------------------------------------------------------------
main(
	 int			argc,
	 const char*	argv[])

/* Setup */

	FileUtility f;

	if (getParams(argc, argv, f, baseDir, outputRoot, category, skip,
iterCount) == true)
	{

/* Does all the testing here. */

	}

---------------------------------------------------------------
And getParams called f.checkDir:
---------------------------------------------------------------

bool
getParams(int argc,  const char*	argv[], /*...*/ )
{
/* [...] */
		if (f.checkDir(pathSep + XalanDOMString(argv[1])))
		{
			assign(baseDir, XalanDOMString(argv[1]));
			insert(baseDir, 0, pathSep);
		}
		else
		{
			cout << endl << "Given base directory \"" << argv[1] << "\" does not
exist" << endl;
			printArgOptions();
			return false;
		}
	}

-------------------------------------------------------------

The effect seem to be: concatename a '\' character to the FRONT of the
directory name, and see if it is valid. Unfortunately,
"\C:\TempXalanAndXerces\xml-xalan\test\tests\conf" is not a valid directory
name on Windoze machines, so getParams fails, and thus the program fails.

The odd thing is that the pattern "main calling getParams(argc, argv)
calling f.checkDir(pathSep + XalanDOMString(argv[1]))" is repeated in most
of the test programs: conf, compare, dom2dom, etc. I thought it would be
logical to call "f.checkDir(XalanDOMString(argv[1]))" instead.

Anyway, I think that's the end of my ramble. I'll get to the questions:

(a) Am I calling the program right? Is just one parameter sufficient?

(b) Why is an initial slash added to path name in calling f.checkDir? Is it
for Unix compatibility?

(c) Is there anything I can do to correct this problem?

Any help would be appreciated.

Regards,
Peter.