You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by pa...@apache.org on 2001/09/14 23:02:49 UTC
cvs commit: xml-xalan/c/Tests/Conf conf.cpp
pauldick 01/09/14 14:02:49
Modified: c/Tests/Conf conf.cpp
Log:
Numerous changes; provide better logging and results
Revision Changes Path
1.3 +37 -43 xml-xalan/c/Tests/Conf/conf.cpp
Index: conf.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Conf/conf.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- conf.cpp 2001/08/30 17:48:53 1.2
+++ conf.cpp 2001/09/14 21:02:49 1.3
@@ -94,7 +94,7 @@
#endif
const char* const excludeStylesheets[] =
-{
+{/*
"attribset17.xsl",
"attribvaltemplate08.xsl",
"copy38.xsl",
@@ -120,8 +120,11 @@
"output17.xsl",
"output18.xsl",
"output25.xsl",
- "output26.xsl",
- "output31.xsl",
+ "output26.xsl", */
+ "output28.xsl",
+ "output80.xsl",
+ "numberformat06.xsl",
+/* "output31.xsl",
"output33.xsl",
"output34.xsl",
"output35.xsl",
@@ -156,7 +159,7 @@
"sort30.xsl",
"sort31.xsl",
"sort35.xsl",
- "sort37.xsl",
+ "sort37.xsl", */
0
};
@@ -240,6 +243,7 @@
if(i < argc && argv[i][0] != '-')
{
assign(goldRoot, XalanDOMString(argv[i]));
+ insert(goldRoot, 0, pathSep);
fsetGold = false;
}
else
@@ -284,28 +288,30 @@
goldRoot = baseDir;
append(goldRoot,XalanDOMString("-gold"));
f.checkAndCreateDir(goldRoot);
- append(goldRoot,pathSep);
+ //append(goldRoot,pathSep);
}
// Add the path seperator to the end of the base directory
// here after we've finished using it for all directory creation.
append(baseDir,pathSep);
+ append(goldRoot,pathSep);
return fSuccess;
}
+
inline bool
checkForExclusion(XalanDOMString currentFile)
{
+ for (int i=0; excludeStylesheets[i] != 0; i++)
+ {
+ if (equals(currentFile, XalanDOMString(excludeStylesheets[i])))
+ {
+ return true;
+ }
+ }
- for (int i=0; excludeStylesheets[i] != 0; i++)
- {
- if (equals(currentFile, XalanDOMString(excludeStylesheets[i])))
- {
- return true;
- }
- }
- return false;
+ return false;
}
int
@@ -324,8 +330,8 @@
XalanTransformer::initialize();
{
- Hashtable runAttrs; // Attribute list for perfdata element
- int transResult = 0;
+ Hashtable runAttrs; // Attribute lists for conformance testing.
+ int theResult = 0;
XalanDOMString category; // Test all of base dir by default
XalanDOMString baseDir, outputRoot, goldRoot;
@@ -358,7 +364,7 @@
// Create run entry that contains runid and number of iterations used for averages.
runAttrs.insert(Hashtable::value_type(XalanDOMString("UniqRunid"), UniqRunid));
runAttrs.insert(Hashtable::value_type(XalanDOMString("Xerces-Version "), futil.getXercesVersion()));
- logFile.logElement(10, "Rundata", runAttrs, "xxx");
+ logFile.logElementWAttrs(10, "RunAttrs", runAttrs, "xxx");
// Get the list of Directories that are below conf
const FileNameVectorType dirs = futil.getDirectoryNames(baseDir);
@@ -385,13 +391,9 @@
for(FileNameVectorType::size_type i = 0; i < files.size(); i++)
{
-
Hashtable attrs;
const XalanDOMString currentFile(files[i]);
-
- //attrs.insert(Hashtable::value_type(XalanDOMString("idref"), currentFile));
- //attrs.insert(Hashtable::value_type(XalanDOMString("UniqRunid"),UniqRunid));
- //attrs.insert(Hashtable::value_type(XalanDOMString("processor"),processorType));
+ futil.data.testOrFile = currentFile;
if (checkForExclusion(currentFile))
continue;
@@ -403,18 +405,12 @@
const XalanDOMString outbase = outputRoot + currentDir + pathSep + currentFile;
const XalanDOMString theOutputFile = futil.GenerateFileName(outbase, "out");
- //cout << endl << endl << "Processing: " << currentFile << endl;
const XSLTInputSource xslInputSource(c_wstr(theXSLFile));
const XSLTInputSource xmlInputSource(c_wstr(theXMLFile));
- const XSLTInputSource goldInputSource(c_wstr(theGoldFile));
+ //const XSLTInputSource goldInputSource(c_wstr(theGoldFile));
+ const XSLTResultTarget resultFile(theOutputFile);
- // Use a XalanSourceTreeDocument to create the XSLTResultTarget.
- XalanSourceTreeDocument* dom = parserLiaison.createXalanSourceTreeDocument();
- FormatterToSourceTree domOut(dom);
- XSLTResultTarget domResultTarget;
- domResultTarget.setDocumentHandler(&domOut);
-
//
// Parsing(compile) the XSL stylesheet and report the results..
//
@@ -422,6 +418,7 @@
xalan.compileStylesheet(xslInputSource, compiledSS);
if (compiledSS == 0 )
{
+ cout << "Failed to PARSE stylesheet for " << currentFile << endl;
continue;
}
@@ -432,26 +429,21 @@
xalan.parseSource(xmlInputSource, parsedSource);
if (parsedSource == 0)
{
+ cout << "Failed to PARSE source document for " << currentFile << endl;
continue;
}
//
- // Perform One transform using parsed stylesheet and unparsed xml source, report results...
+ // Perform One transform using parsed stylesheet and parsed xml source, report results...
//
- transResult = xalan.transform(*parsedSource, compiledSS, domResultTarget);
-
- if(!transResult)
+ theResult = xalan.transform(*parsedSource, compiledSS, resultFile);
+ if (!theResult)
{
- futil.compareResults(theOutputFile, compiledSS, dom, currentFile, goldInputSource);
+ futil.checkResults(theOutputFile,
+ theGoldFile,
+ logFile);
}
- else
- {
- cout << xalan.getLastError(); // This never seems to be called!!
- return 0;
- }
- logFile.logCheckPass(currentFile);
-
parserLiaison.reset();
xalan.destroyParsedSource(parsedSource);
xalan.destroyStylesheet(compiledSS);
@@ -462,13 +454,15 @@
} //for directories
- logFile.logTestFileClose("Conformance ", "Done");
- logFile.close();
+ futil.reportPassFail(logFile);
+ logFile.logTestFileClose("Conformance ", "Done");
+ logFile.close();
} //if getParams
}
XalanTransformer::terminate();
+
return 0;
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org