aboutsummaryrefslogtreecommitdiffstats
path: root/runxmlconf.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2008-08-25 14:53:31 +0000
committerDaniel Veillard <veillard@src.gnome.org>2008-08-25 14:53:31 +0000
commitaa6de47ebf0d4f96ed83e06c79a870a4e9b5dd0e (patch)
tree12f0353b21360a010e0ca3ed7609df1c227e2168 /runxmlconf.c
parentf4f4e4853a925905deb77a72a3311ab683fbeeb5 (diff)
downloadandroid_external_libxml2-aa6de47ebf0d4f96ed83e06c79a870a4e9b5dd0e.tar.gz
android_external_libxml2-aa6de47ebf0d4f96ed83e06c79a870a4e9b5dd0e.tar.bz2
android_external_libxml2-aa6de47ebf0d4f96ed83e06c79a870a4e9b5dd0e.zip
applied patch from Aswin to fix tree skipping fixed a comment and added a
* xmlreader.c: applied patch from Aswin to fix tree skipping * include/libxml/entities.h entities.c: fixed a comment and added a new xmlNewEntity() entry point * runtest.c: be less verbose * tree.c: space and tabs cleanups daniel svn path=/trunk/; revision=3774
Diffstat (limited to 'runxmlconf.c')
-rw-r--r--runxmlconf.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/runxmlconf.c b/runxmlconf.c
index 2a1aa9dd..0529058e 100644
--- a/runxmlconf.c
+++ b/runxmlconf.c
@@ -446,22 +446,27 @@ error:
}
static int
-xmlconfTestCases(xmlDocPtr doc, xmlNodePtr cur) {
+xmlconfTestCases(xmlDocPtr doc, xmlNodePtr cur, int level) {
xmlChar *profile;
int ret = 0;
int tests = 0;
-
- profile = xmlGetProp(cur, BAD_CAST "PROFILE");
- if (profile != NULL) {
- printf("Test cases: %s\n", (char *) profile);
- xmlFree(profile);
+ int output = 0;
+
+ if (level == 1) {
+ profile = xmlGetProp(cur, BAD_CAST "PROFILE");
+ if (profile != NULL) {
+ output = 1;
+ level++;
+ printf("Test cases: %s\n", (char *) profile);
+ xmlFree(profile);
+ }
}
cur = cur->children;
while (cur != NULL) {
/* look only at elements we ignore everything else */
if (cur->type == XML_ELEMENT_NODE) {
if (xmlStrEqual(cur->name, BAD_CAST "TESTCASES")) {
- ret += xmlconfTestCases(doc, cur);
+ ret += xmlconfTestCases(doc, cur, level);
} else if (xmlStrEqual(cur->name, BAD_CAST "TEST")) {
if (xmlconfTestItem(doc, cur) >= 0)
ret++;
@@ -472,8 +477,10 @@ xmlconfTestCases(xmlDocPtr doc, xmlNodePtr cur) {
}
cur = cur->next;
}
- if (tests > 0)
- printf("Test cases: %d tests\n", tests);
+ if (output == 1) {
+ if (tests > 0)
+ printf("Test cases: %d tests\n", tests);
+ }
return(ret);
}
@@ -493,7 +500,7 @@ xmlconfTestSuite(xmlDocPtr doc, xmlNodePtr cur) {
/* look only at elements we ignore everything else */
if (cur->type == XML_ELEMENT_NODE) {
if (xmlStrEqual(cur->name, BAD_CAST "TESTCASES")) {
- ret += xmlconfTestCases(doc, cur);
+ ret += xmlconfTestCases(doc, cur, 1);
} else {
fprintf(stderr, "Unhandled element %s\n", (char *)cur->name);
}
@@ -584,6 +591,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
ret = 1;
printf("Total %d tests, %d errors, %d leaks\n",
nb_tests, nb_errors, nb_leaks);
+ printf("See %s for detailed output\n", LOGFILE);
}
xmlXPathFreeContext(ctxtXPath);
xmlCleanupParser();