summaryrefslogtreecommitdiff
path: root/runsuite.c
diff options
context:
space:
mode:
Diffstat (limited to 'runsuite.c')
-rw-r--r--runsuite.c53
1 files changed, 33 insertions, 20 deletions
diff --git a/runsuite.c b/runsuite.c
index aecd6ae..4e9858a 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -6,11 +6,16 @@
* daniel@veillard.com
*/
+#ifdef HAVE_CONFIG_H
+#include "libxml.h"
+#else
+#include <stdio.h>
+#endif
+
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <unistd.h>
#endif
#include <string.h>
-#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -31,11 +36,16 @@
#define LOGFILE "runsuite.log"
static FILE *logfile = NULL;
-static int verbose = 0;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define vsnprintf _vsnprintf
-#define snprintf _snprintf
+static int verbose = 0;
+
+
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
+#define vsnprintf _vsnprintf
+
+#define snprintf _snprintf
+
#endif
/************************************************************************
@@ -83,7 +93,6 @@ static int nb_internals = 0;
static int nb_schematas = 0;
static int nb_unimplemented = 0;
static int nb_leaks = 0;
-static long libxmlMemoryAllocatedBase = 0;
static int extraMemoryFromResolver = 0;
static int
@@ -225,7 +234,6 @@ initializeLibxml2(void) {
xmlSchemaInitTypes();
xmlRelaxNGInitTypes();
#endif
- libxmlMemoryAllocatedBase = xmlMemUsed();
}
static xmlNodePtr
@@ -931,9 +939,17 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
}
instance = getNext(cur, "./ts:instanceTest[1]");
while (instance != NULL) {
- xstcTestInstance(instance, schemas, path, base);
+ if (schemas != NULL) {
+ xstcTestInstance(instance, schemas, path, base);
+ } else {
+ /*
+ * We'll automatically mark the instances as failed
+ * if the schema was broken.
+ */
+ nb_errors++;
+ }
instance = getNext(instance,
- "following-sibling::ts:instanceTest[1]");
+ "following-sibling::ts:instanceTest[1]");
}
} else if (xmlStrEqual(validity, BAD_CAST "invalid")) {
nb_schematas++;
@@ -1033,7 +1049,7 @@ done:
int
main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
- int res, ret = 0;
+ int ret = 0;
int old_errors, old_tests, old_leaks;
logfile = fopen(LOGFILE, "w");
@@ -1051,7 +1067,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_errors = nb_errors;
old_tests = nb_tests;
old_leaks = nb_leaks;
- res = xsdTest();
+ xsdTest();
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests, no errors\n", nb_tests - old_tests);
else
@@ -1062,7 +1078,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_errors = nb_errors;
old_tests = nb_tests;
old_leaks = nb_leaks;
- res = rngTest1();
+ rngTest1();
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests, no errors\n", nb_tests - old_tests);
else
@@ -1073,7 +1089,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_errors = nb_errors;
old_tests = nb_tests;
old_leaks = nb_leaks;
- res = rngTest2();
+ rngTest2();
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests, no errors\n", nb_tests - old_tests);
else
@@ -1086,8 +1102,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_leaks = nb_leaks;
nb_internals = 0;
nb_schematas = 0;
- res = xstcMetadata(
- "xstc/Tests/Metadata/NISTXMLSchemaDatatypes.testSet",
+ xstcMetadata("xstc/Tests/Metadata/NISTXMLSchemaDatatypes.testSet",
"xstc/Tests/Metadata/");
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests (%d schemata), no errors\n",
@@ -1104,8 +1119,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_leaks = nb_leaks;
nb_internals = 0;
nb_schematas = 0;
- res = xstcMetadata(
- "xstc/Tests/Metadata/SunXMLSchema1-0-20020116.testSet",
+ xstcMetadata("xstc/Tests/Metadata/SunXMLSchema1-0-20020116.testSet",
"xstc/Tests/");
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests (%d schemata), no errors\n",
@@ -1122,8 +1136,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_leaks = nb_leaks;
nb_internals = 0;
nb_schematas = 0;
- res = xstcMetadata(
- "xstc/Tests/Metadata/MSXMLSchema1-0-20020116.testSet",
+ xstcMetadata("xstc/Tests/Metadata/MSXMLSchema1-0-20020116.testSet",
"xstc/Tests/");
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests (%d schemata), no errors\n",