Changeset 9b20126 in mainline for uspace/lib/pcut/src/report/xml.c
- Timestamp:
- 2014-09-19T08:23:01Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c85a57f
- Parents:
- 15d0046
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/report/xml.c
r15d0046 r9b20126 53 53 */ 54 54 static void xml_init(pcut_item_t *all_items) { 55 printf("<?xml version=\"1.0\"?>\n");56 57 55 int tests_total = pcut_count_tests(all_items); 58 56 test_counter = 0; 59 57 58 printf("<?xml version=\"1.0\"?>\n"); 60 59 printf("<report tests-total=\"%d\">\n", tests_total); 61 60 } … … 69 68 failed_tests_in_suite = 0; 70 69 71 printf("\t<suite name=\"%s\">\n", suite-> suite.name);70 printf("\t<suite name=\"%s\">\n", suite->name); 72 71 } 73 72 … … 77 76 */ 78 77 static void xml_suite_done(pcut_item_t *suite) { 79 printf("\t</suite><!-- %s: %d / %d -->\n", suite-> suite.name,78 printf("\t</suite><!-- %s: %d / %d -->\n", suite->name, 80 79 failed_tests_in_suite, tests_in_suite); 81 80 } … … 100 99 */ 101 100 static void print_by_lines(const char *message, const char *element_name) { 101 char *next_line_start; 102 102 103 if ((message == NULL) || (message[0] == 0)) { 103 104 return; … … 106 107 printf("\t\t\t<%s><![CDATA[", element_name); 107 108 108 char *next_line_start = pcut_str_find_char(message, '\n');109 next_line_start = pcut_str_find_char(message, '\n'); 109 110 while (next_line_start != NULL) { 110 111 next_line_start[0] = 0; … … 131 132 const char *error_message, const char *teardown_error_message, 132 133 const char *extra_output) { 133 const char *test_name = test->test.name; 134 const char *test_name = test->name; 135 const char *status_str = NULL; 134 136 135 137 if (outcome != TEST_OUTCOME_PASS) { … … 137 139 } 138 140 139 const char *status_str = NULL;140 141 switch (outcome) { 141 142 case TEST_OUTCOME_PASS: … … 165 166 166 167 /** Report testing done. */ 167 static void xml_done( ) {168 static void xml_done(void) { 168 169 printf("</report>\n"); 169 170 } … … 171 172 172 173 pcut_report_ops_t pcut_report_xml = { 173 .init = xml_init, 174 .done = xml_done, 175 .suite_start = xml_suite_start, 176 .suite_done = xml_suite_done, 177 .test_start = xml_test_start, 178 .test_done = xml_test_done 174 xml_init, xml_done, 175 xml_suite_start, xml_suite_done, 176 xml_test_start, xml_test_done 179 177 };
Note:
See TracChangeset
for help on using the changeset viewer.