Changeset 4b54bd9 in mainline for uspace/lib/pcut/src/report/xml.c
- Timestamp:
- 2018-09-12T13:23:03Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3da0ee4
- Parents:
- 275530a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/report/xml.c
r275530a4 r4b54bd9 34 34 #include "../internal.h" 35 35 #include "report.h" 36 36 37 #ifndef __helenos__ 38 #pragma warning(push, 0) 37 39 #include <string.h> 40 #pragma warning(pop) 38 41 #endif 42 43 #pragma warning(push, 0) 39 44 #include <stdio.h> 45 #pragma warning(pop) 46 40 47 41 48 /** Counter of all run tests. */ … … 52 59 * @param all_items Start of the list with all items. 53 60 */ 54 static void xml_init(pcut_item_t *all_items) 55 { 61 static void xml_init(pcut_item_t *all_items) { 56 62 int tests_total = pcut_count_tests(all_items); 57 63 test_counter = 0; … … 65 71 * @param suite Suite that just started. 66 72 */ 67 static void xml_suite_start(pcut_item_t *suite) 68 { 73 static void xml_suite_start(pcut_item_t *suite) { 69 74 tests_in_suite = 0; 70 75 failed_tests_in_suite = 0; … … 77 82 * @param suite Suite that just ended. 78 83 */ 79 static void xml_suite_done(pcut_item_t *suite) 80 { 84 static void xml_suite_done(pcut_item_t *suite) { 81 85 printf("\t</suite><!-- %s: %d / %d -->\n", suite->name, 82 86 failed_tests_in_suite, tests_in_suite); 83 87 } 84 88 … … 89 93 * @param test Test that is started. 90 94 */ 91 static void xml_test_start(pcut_item_t *test) 92 { 95 static void xml_test_start(pcut_item_t *test) { 93 96 PCUT_UNUSED(test); 94 97 … … 102 105 * @param element_name Wrapping XML element name. 103 106 */ 104 static void print_by_lines(const char *message, const char *element_name) 105 { 107 static void print_by_lines(const char *message, const char *element_name) { 106 108 char *next_line_start; 107 109 … … 135 137 */ 136 138 static void xml_test_done(pcut_item_t *test, int outcome, 137 const char *error_message, const char *teardown_error_message, 138 const char *extra_output) 139 { 139 const char *error_message, const char *teardown_error_message, 140 const char *extra_output) { 140 141 const char *test_name = test->name; 141 142 const char *status_str = NULL; … … 158 159 159 160 printf("\t\t<testcase name=\"%s\" status=\"%s\">\n", test_name, 160 161 status_str); 161 162 162 163 print_by_lines(error_message, "error-message"); … … 169 170 170 171 /** Report testing done. */ 171 static void xml_done(void) 172 { 172 static void xml_done(void) { 173 173 printf("</report>\n"); 174 174 }
Note:
See TracChangeset
for help on using the changeset viewer.