| 441 | } |
| 442 | |
| 443 | static int |
| 444 | xmlconfTestCases(xmlDocPtr doc, xmlNodePtr cur, int level) { |
| 445 | xmlChar *profile; |
| 446 | int ret = 0; |
| 447 | int tests = 0; |
| 448 | int output = 0; |
| 449 | |
| 450 | if (level == 1) { |
| 451 | profile = xmlGetProp(cur, BAD_CAST "PROFILE"); |
| 452 | if (profile != NULL) { |
| 453 | output = 1; |
| 454 | level++; |
| 455 | printf("Test cases: %s\n", (char *) profile); |
| 456 | xmlFree(profile); |
| 457 | } |
| 458 | } |
| 459 | cur = cur->children; |
| 460 | while (cur != NULL) { |
| 461 | /* look only at elements we ignore everything else */ |
| 462 | if (cur->type == XML_ELEMENT_NODE) { |
| 463 | if (xmlStrEqual(cur->name, BAD_CAST "TESTCASES")) { |
| 464 | ret += xmlconfTestCases(doc, cur, level); |
| 465 | } else if (xmlStrEqual(cur->name, BAD_CAST "TEST")) { |
| 466 | if (xmlconfTestItem(doc, cur) >= 0) |
| 467 | ret++; |
| 468 | tests++; |
| 469 | } else { |
| 470 | fprintf(stderr, "Unhandled element %s\n", (char *)cur->name); |
| 471 | } |
| 472 | } |
| 473 | cur = cur->next; |
| 474 | } |
| 475 | if (output == 1) { |
| 476 | if (tests > 0) |
| 477 | printf("Test cases: %d tests\n", tests); |
| 478 | } |
| 479 | return(ret); |
| 480 | } |
| 481 | |
| 482 | static int |
| 483 | xmlconfTestSuite(xmlDocPtr doc, xmlNodePtr cur) { |
no test coverage detected