| 1 | #cxx . . $ `<file>/src/text_reporter.c`/include <cgreen/reporter.h>cxx . . $ `<file>/include/cgreen/reporter.h`/ |
| 2 | #include <cgreen/breadcrumb.h>cxx . . $ `<file>/include/cgreen/breadcrumb.h`/ |
| 3 | #include <stdlib.h> |
| 4 | #include <stdio.h> |
| 5 | #include <string.h> |
| 6 | #include <stdbool.h> |
| 7 | |
| 8 | #include <cgreen/text_reporter.h>cxx . . $ `<file>/include/cgreen/text_reporter.h`/ |
| 9 | #include "text_reporter_internal.h"cxx . . $ `<file>/src/text_reporter_internal.h`/ |
| 10 | |
| 11 | #ifdef __ANDROID__ |
| 12 | #include "cgreen/internal/android_headers/androidcompat.h" |
| 13 | #endif // #ifdef __ANDROID__ |
| 14 | |
| 15 | #define GREENcxx . . $ `src/text_reporter.c:15:9`! "\x1b[32m" |
| 16 | #define YELLOWcxx . . $ `src/text_reporter.c:16:9`! "\x1b[33m" |
| 17 | #define REDcxx . . $ `src/text_reporter.c:17:9`! "\x1b[31m" |
| 18 | #define MAGENTAcxx . . $ `src/text_reporter.c:18:9`! "\x1b[35m" |
| 19 | #define RESETcxx . . $ `src/text_reporter.c:19:9`! "\x1b[0m" |
| 20 | |
| 21 | |
| 22 | static void text_reporter_start_suitecxx . . $ text_reporter_start_suite(8490445735e6bcce).(TestReportercxx . . $ TestReporter# *reporter, const char *name, |
| 23 | const int number_of_tests); |
| 24 | static void text_reporter_start_testcxx . . $ text_reporter_start_test(499118f5be74126f).(TestReportercxx . . $ TestReporter# *reporter, const char *name); |
| 25 | static void text_reporter_finishcxx . . $ text_reporter_finish(4c7a3a1bff8d25e8).(TestReportercxx . . $ TestReporter# *reporter, const char *filename, |
| 26 | int line, const char *message); |
| 27 | static void show_failcxx . . $ show_fail(fabf0cf23815ef65).(TestReportercxx . . $ TestReporter# *reporter, const char *file, int line, |
| 28 | const char *message, va_listcxx . . $ va_list# arguments); |
| 29 | static void show_incompletecxx . . $ show_incomplete(fabf0cf23815ef65).(TestReportercxx . . $ TestReporter# *reporter, const char *file, int line, |
| 30 | const char *message, va_listcxx . . $ va_list# arguments); |
| 31 | static void show_breadcrumbcxx . . $ show_breadcrumb(4611f29f2f861a56).(const char *name, void *memo); |
| 32 | static void text_reporter_finish_suitecxx . . $ text_reporter_finish_suite(8490445735e6bcce).(TestReportercxx . . $ TestReporter# *reporter, const char *file, int line); |
| 33 | |
| 34 | |
| 35 | /* To be able to run a reporter as CUT for testing with Cgreen itself |
| 36 | we need two reporters simultaneously, so the injected printer needs |
| 37 | to be local to the reporter which means we must store it in the |
| 38 | memo and use that. This requires a single printer function to be |
| 39 | used, often printf() or similar, so any other tricks needs to be |
| 40 | performed in char buffers so that memo->printer can do the |
| 41 | printing. |
| 42 | */ |
| 43 | typedef structcxx . . $ $anonymous_type_dc6cefad400bcc1f_0# { |
| 44 | TextPrintercxx . . $ TextPrinter# *printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.; |
| 45 | TextVPrintercxx . . $ TextVPrinter# *vprintercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#vprinter.; |
| 46 | int depthcxx . . $ $anonymous_type_dc6cefad400bcc1f_0#depth.; |
| 47 | } TextMemocxx . . $ TextMemo#; |
| 48 | |
| 49 | |
| 50 | void set_text_reporter_printercxx . . $ set_text_reporter_printer(ecb5d6da6d3395c).(TestReportercxx . . $ TestReporter# *reporter, TextPrintercxx . . $ TextPrinter# *new_printer) { |
| 51 | TextMemocxx . . $ TextMemo# *memo = (TextMemocxx . . $ TextMemo# *)reporter->memocxx . . $ TestReporter_#memo.; |
| 52 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer. = new_printer; |
| 53 | } |
| 54 | |
| 55 | void set_text_reporter_vprintercxx . . $ set_text_reporter_vprinter(6046060cadba98d3).(TestReportercxx . . $ TestReporter# *reporter, TextVPrintercxx . . $ TextVPrinter# *new_vprinter) { |
| 56 | TextMemocxx . . $ TextMemo# *memo = (TextMemocxx . . $ TextMemo# *)reporter->memocxx . . $ TestReporter_#memo.; |
| 57 | memo->vprintercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#vprinter. = new_vprinter; |
| 58 | } |
| 59 | |
| 60 | TestReportercxx . . $ TestReporter# *create_text_reportercxx . . $ create_text_reporter(a6a8ef953e197a65).(void) { |
| 61 | TextMemocxx . . $ TextMemo# *memo; |
| 62 | TestReportercxx . . $ TestReporter# *reporter = create_reportercxx . . $ create_reporter(a6a8ef953e197a65).(); |
| 63 | |
| 64 | if (reporter == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) { |
| 65 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 66 | } |
| 67 | |
| 68 | memo = (TextMemocxx . . $ TextMemo# *)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(TextMemocxx . . $ TextMemo#)); |
| 69 | if (memo == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) { |
| 70 | destroy_reportercxx . . $ destroy_reporter(1083e9dac9de8fd0).(reporter); |
| 71 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 72 | } |
| 73 | reporter->memocxx . . $ TestReporter_#memo. = memo; |
| 74 | |
| 75 | reporter->start_suitecxx . . $ TestReporter_#start_suite. = &text_reporter_start_suitecxx . . $ text_reporter_start_suite(8490445735e6bcce).; |
| 76 | reporter->start_testcxx . . $ TestReporter_#start_test. = &text_reporter_start_testcxx . . $ text_reporter_start_test(499118f5be74126f).; |
| 77 | reporter->show_failcxx . . $ TestReporter_#show_fail. = &show_failcxx . . $ show_fail(fabf0cf23815ef65).; |
| 78 | reporter->show_incompletecxx . . $ TestReporter_#show_incomplete. = &show_incompletecxx . . $ show_incomplete(fabf0cf23815ef65).; |
| 79 | reporter->finish_testcxx . . $ TestReporter_#finish_test. = &text_reporter_finishcxx . . $ text_reporter_finish(4c7a3a1bff8d25e8).; |
| 80 | reporter->finish_suitecxx . . $ TestReporter_#finish_suite. = &text_reporter_finish_suitecxx . . $ text_reporter_finish_suite(8490445735e6bcce).; |
| 81 | |
| 82 | set_text_reporter_printercxx . . $ set_text_reporter_printer(ecb5d6da6d3395c).(reporter, printfcxx . . $ printf(581fddd72a8db8fc).); |
| 83 | set_text_reporter_vprintercxx . . $ set_text_reporter_vprinter(6046060cadba98d3).(reporter, vprintfcxx . . $ vprintf(5c80dbd47e6ebfbb).); |
| 84 | |
| 85 | return reporter; |
| 86 | } |
| 87 | |
| 88 | |
| 89 | static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_quiet_modecxx . . $ have_quiet_mode(a7dfc52e252d5ebe).(TestReportercxx . . $ TestReporter# *reporter) { |
| 90 | return reporter->optionscxx . . $ TestReporter_#options.&&((TextReporterOptionscxx . . $ TextReporterOptions# *)reporter->optionscxx . . $ TestReporter_#options.)->quiet_modecxx . . $ text_reporter_options#quiet_mode.; |
| 91 | } |
| 92 | |
| 93 | static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! inhibit_start_suite_messagecxx . . $ inhibit_start_suite_message(a7dfc52e252d5ebe).(TestReportercxx . . $ TestReporter# *reporter) { |
| 94 | return reporter->optionscxx . . $ TestReporter_#options.&&((TextReporterOptionscxx . . $ TextReporterOptions# *)reporter->optionscxx . . $ TestReporter_#options.)->inhibit_start_suite_messagecxx . . $ text_reporter_options#inhibit_start_suite_message.; |
| 95 | } |
| 96 | |
| 97 | static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! inhibit_finish_suite_messagecxx . . $ inhibit_finish_suite_message(a7dfc52e252d5ebe).(TestReportercxx . . $ TestReporter# *reporter) { |
| 98 | return reporter->optionscxx . . $ TestReporter_#options.&&((TextReporterOptionscxx . . $ TextReporterOptions# *)reporter->optionscxx . . $ TestReporter_#options.)->inhibit_finish_suite_messagecxx . . $ text_reporter_options#inhibit_finish_suite_message.; |
| 99 | } |
| 100 | |
| 101 | static void text_reporter_start_suitecxx . . $ text_reporter_start_suite(8490445735e6bcce).(TestReportercxx . . $ TestReporter# *reporter, const char *name, |
| 102 | const int number_of_tests) { |
| 103 | TextMemocxx . . $ TextMemo# *memo = (TextMemocxx . . $ TextMemo# *)reporter->memocxx . . $ TestReporter_#memo.; |
| 104 | |
| 105 | reporter->passescxx . . $ TestReporter_#passes. = 0; |
| 106 | reporter->failurescxx . . $ TestReporter_#failures. = 0; |
| 107 | reporter->skipscxx . . $ TestReporter_#skips. = 0; |
| 108 | reporter->exceptionscxx . . $ TestReporter_#exceptions. = 0; |
| 109 | |
| 110 | reporter_start_testcxx . . $ reporter_start_test(499118f5be74126f).(reporter, name); |
| 111 | if (get_breadcrumb_depthcxx . . $ get_breadcrumb_depth(8ca6eaf309ea46b8).((CgreenBreadcrumbcxx . . $ CgreenBreadcrumb# *) reporter->breadcrumbcxx . . $ TestReporter_#breadcrumb.) == 1) { |
| 112 | if (!have_quiet_modecxx . . $ have_quiet_mode(a7dfc52e252d5ebe).(reporter) && !inhibit_start_suite_messagecxx . . $ inhibit_start_suite_message(a7dfc52e252d5ebe).(reporter)) |
| 113 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("Running \"%s\" (%d test%s)...\n", |
| 114 | get_current_from_breadcrumbcxx . . $ get_current_from_breadcrumb(fb00be60b058c643).((CgreenBreadcrumbcxx . . $ CgreenBreadcrumb# *) reporter->breadcrumbcxx . . $ TestReporter_#breadcrumb.), |
| 115 | number_of_tests, |
| 116 | number_of_tests==1?"":"s"); |
| 117 | fflushcxx . . $ fflush(89bc1efcdac0ca22).(stdoutcxx . . $ `<external>/232824719582829767/stdio.h:158:9`!); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | static void text_reporter_start_testcxx . . $ text_reporter_start_test(499118f5be74126f).(TestReportercxx . . $ TestReporter# *reporter, const char *name) { |
| 122 | reporter_start_testcxx . . $ reporter_start_test(499118f5be74126f).(reporter, name); |
| 123 | } |
| 124 | |
| 125 | static void text_reporter_finishcxx . . $ text_reporter_finish(4c7a3a1bff8d25e8).(TestReportercxx . . $ TestReporter# *reporter, const char *filename, |
| 126 | int line, const char *message) { |
| 127 | reporter_finish_testcxx . . $ reporter_finish_test(4c7a3a1bff8d25e8).(reporter, filename, line, message); |
| 128 | } |
| 129 | |
| 130 | |
| 131 | static void format_countcxx . . $ format_count(3263eb93ad84a0b2).(char *buff, int count, const char *name, const char *color, const char *plural, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! use_colors) { |
| 132 | const char *color_on = use_colors?color:""; |
| 133 | const char *color_off = use_colors?RESETcxx . . $ `src/text_reporter.c:19:9`!:""; |
| 134 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(buff, "%s%d %s%s%s", count>0?color_on:"", count, name, count==1?"":plural, color_off); |
| 135 | } |
| 136 | |
| 137 | static char *format_passescxx . . $ format_passes(543b21385757c369).(int passes, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! use_colors) { |
| 138 | static char buff[100]; |
| 139 | format_countcxx . . $ format_count(3263eb93ad84a0b2).(buff, passes, "pass", GREENcxx . . $ `src/text_reporter.c:15:9`!, "es", use_colors); |
| 140 | return buff; |
| 141 | } |
| 142 | |
| 143 | static char *format_skipscxx . . $ format_skips(543b21385757c369).(int skips, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! use_colors) { |
| 144 | static char buff[100]; |
| 145 | format_countcxx . . $ format_count(3263eb93ad84a0b2).(buff, skips, "skipped", YELLOWcxx . . $ `src/text_reporter.c:16:9`!, "", use_colors); |
| 146 | return buff; |
| 147 | } |
| 148 | |
| 149 | static char *format_failurescxx . . $ format_failures(543b21385757c369).(int failures, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! use_colors) { |
| 150 | static char buff[100]; |
| 151 | format_countcxx . . $ format_count(3263eb93ad84a0b2).(buff, failures, "failure", REDcxx . . $ `src/text_reporter.c:17:9`!, "s", use_colors); |
| 152 | return buff; |
| 153 | } |
| 154 | |
| 155 | static char *format_exceptionscxx . . $ format_exceptions(543b21385757c369).(int exceptions, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! use_colors) { |
| 156 | static char buff[100]; |
| 157 | format_countcxx . . $ format_count(3263eb93ad84a0b2).(buff, exceptions, "exception", MAGENTAcxx . . $ `src/text_reporter.c:18:9`!, "s", use_colors); |
| 158 | return buff; |
| 159 | } |
| 160 | |
| 161 | static char *format_durationcxx . . $ format_duration(f109d7e0a0ca42b3).(uint32_tcxx . . $ uint32_t# duration) { |
| 162 | static char buff[100]; |
| 163 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(buff, sizeof(buff), " in %dms", duration); |
| 164 | return buff; |
| 165 | } |
| 166 | |
| 167 | static void insert_commacxx . . $ insert_comma(fda57c8427c60377).(char buf[]) { |
| 168 | if (buf[strlencxx . . $ strlen(751346f8406fd082).(buf)-1] != ' ') |
| 169 | strcatcxx . . $ strcat(b7b3a83273496486).(buf, ", "); |
| 170 | } |
| 171 | |
| 172 | static void text_reporter_print_resultscxx . . $ text_reporter_print_results(7e7a9f829799a73e).(char *buf, char *prepend, |
| 173 | int passes, int failures, int skips, int exceptions, uint32_tcxx . . $ uint32_t# duration, |
| 174 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! use_colors) { |
| 175 | |
| 176 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf, "%s", prepend); |
| 177 | if (passes || failures || skips || exceptions) { |
| 178 | if (passes) |
| 179 | strcatcxx . . $ strcat(b7b3a83273496486).(buf, format_passescxx . . $ format_passes(543b21385757c369).(passes, use_colors)); |
| 180 | if (skips) { |
| 181 | insert_commacxx . . $ insert_comma(fda57c8427c60377).(buf); |
| 182 | strcatcxx . . $ strcat(b7b3a83273496486).(buf, format_skipscxx . . $ format_skips(543b21385757c369).(skips, use_colors)); |
| 183 | } |
| 184 | if (failures) { |
| 185 | insert_commacxx . . $ insert_comma(fda57c8427c60377).(buf); |
| 186 | strcatcxx . . $ strcat(b7b3a83273496486).(buf, format_failurescxx . . $ format_failures(543b21385757c369).(failures, use_colors)); |
| 187 | } |
| 188 | if (exceptions) { |
| 189 | insert_commacxx . . $ insert_comma(fda57c8427c60377).(buf); |
| 190 | strcatcxx . . $ strcat(b7b3a83273496486).(buf, format_exceptionscxx . . $ format_exceptions(543b21385757c369).(exceptions, use_colors)); |
| 191 | } |
| 192 | strcatcxx . . $ strcat(b7b3a83273496486).(buf, format_durationcxx . . $ format_duration(f109d7e0a0ca42b3).(duration)); |
| 193 | } else { |
| 194 | strcatcxx . . $ strcat(b7b3a83273496486).(buf, "No assertions"); |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | static void text_reporter_finish_suitecxx . . $ text_reporter_finish_suite(8490445735e6bcce).(TestReportercxx . . $ TestReporter# *reporter, const char *file, int line) { |
| 199 | const char *name = get_current_from_breadcrumbcxx . . $ get_current_from_breadcrumb(fb00be60b058c643).((CgreenBreadcrumbcxx . . $ CgreenBreadcrumb# *) reporter->breadcrumbcxx . . $ TestReporter_#breadcrumb.); |
| 200 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! use_colors = reporter->optionscxx . . $ TestReporter_#options. && ((TextReporterOptionscxx . . $ TextReporterOptions# *)reporter->optionscxx . . $ TestReporter_#options.)->use_colourscxx . . $ text_reporter_options#use_colours.; |
| 201 | TextMemocxx . . $ TextMemo# *memo = (TextMemocxx . . $ TextMemo# *)reporter->memocxx . . $ TestReporter_#memo.; |
| 202 | |
| 203 | reporter_finish_suitecxx . . $ reporter_finish_suite(8490445735e6bcce).(reporter, file, line); |
| 204 | |
| 205 | reporter->total_passescxx . . $ TestReporter_#total_passes. += reporter->passescxx . . $ TestReporter_#passes.; |
| 206 | reporter->total_failurescxx . . $ TestReporter_#total_failures. += reporter->failurescxx . . $ TestReporter_#failures.; |
| 207 | reporter->total_skipscxx . . $ TestReporter_#total_skips. += reporter->skipscxx . . $ TestReporter_#skips.; |
| 208 | reporter->total_exceptionscxx . . $ TestReporter_#total_exceptions. += reporter->exceptionscxx . . $ TestReporter_#exceptions.; |
| 209 | |
| 210 | if (have_quiet_modecxx . . $ have_quiet_mode(a7dfc52e252d5ebe).(reporter)) { |
| 211 | if (get_breadcrumb_depthcxx . . $ get_breadcrumb_depth(8ca6eaf309ea46b8).((CgreenBreadcrumbcxx . . $ CgreenBreadcrumb# *) reporter->breadcrumbcxx . . $ TestReporter_#breadcrumb.) == 0) { |
| 212 | /* Top-level: end the dot stream and print the totals summary, so that |
| 213 | failed and suspended (xEnsure) tests are visible even in quiet mode. */ |
| 214 | char buf[1000]; |
| 215 | char prepend[100]; |
| 216 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n"); |
| 217 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(prepend, "Completed \"%s\": ", name); |
| 218 | text_reporter_print_resultscxx . . $ text_reporter_print_results(7e7a9f829799a73e).(buf, prepend, |
| 219 | reporter->total_passescxx . . $ TestReporter_#total_passes., |
| 220 | reporter->total_failurescxx . . $ TestReporter_#total_failures., |
| 221 | reporter->total_skipscxx . . $ TestReporter_#total_skips., |
| 222 | reporter->total_exceptionscxx . . $ TestReporter_#total_exceptions., |
| 223 | reporter->total_durationcxx . . $ TestReporter_#total_duration., |
| 224 | use_colors); |
| 225 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("%s.\n", buf); |
| 226 | } else { |
| 227 | if (use_colors) { |
| 228 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.(GREENcxx . . $ `src/text_reporter.c:15:9`!); |
| 229 | if (reporter->skipscxx . . $ TestReporter_#skips.) memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.(YELLOWcxx . . $ `src/text_reporter.c:16:9`!); |
| 230 | if (reporter->failurescxx . . $ TestReporter_#failures.) memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.(REDcxx . . $ `src/text_reporter.c:17:9`!); |
| 231 | if (reporter->exceptionscxx . . $ TestReporter_#exceptions.) memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.(MAGENTAcxx . . $ `src/text_reporter.c:18:9`!); |
| 232 | } |
| 233 | if (reporter->exceptionscxx . . $ TestReporter_#exceptions.) memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("X"); |
| 234 | else if (reporter->failurescxx . . $ TestReporter_#failures.) memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("F"); |
| 235 | else if (reporter->skipscxx . . $ TestReporter_#skips.) memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("S"); |
| 236 | else memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("."); |
| 237 | if (use_colors) { |
| 238 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.(RESETcxx . . $ `src/text_reporter.c:19:9`!); |
| 239 | } |
| 240 | } |
| 241 | } else { |
| 242 | char buf[1000]; |
| 243 | char prepend[100]; |
| 244 | |
| 245 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(prepend, " \"%s\": ", name); |
| 246 | text_reporter_print_resultscxx . . $ text_reporter_print_results(7e7a9f829799a73e).(buf, prepend, |
| 247 | reporter->passescxx . . $ TestReporter_#passes., |
| 248 | reporter->failurescxx . . $ TestReporter_#failures., |
| 249 | reporter->skipscxx . . $ TestReporter_#skips., |
| 250 | reporter->exceptionscxx . . $ TestReporter_#exceptions., |
| 251 | reporter->durationcxx . . $ TestReporter_#duration., |
| 252 | use_colors); |
| 253 | |
| 254 | // Don't report top-level (pseudo-suite) if it had no asserts at all |
| 255 | if (get_breadcrumb_depthcxx . . $ get_breadcrumb_depth(8ca6eaf309ea46b8).((CgreenBreadcrumbcxx . . $ CgreenBreadcrumb# *) reporter->breadcrumbcxx . . $ TestReporter_#breadcrumb.) != 0 || |
| 256 | (reporter->passescxx . . $ TestReporter_#passes. || reporter->failurescxx . . $ TestReporter_#failures. || reporter->skipscxx . . $ TestReporter_#skips. || reporter->exceptionscxx . . $ TestReporter_#exceptions.)) { |
| 257 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("%s.\n", buf); |
| 258 | } |
| 259 | |
| 260 | // Report totals |
| 261 | if (get_breadcrumb_depthcxx . . $ get_breadcrumb_depth(8ca6eaf309ea46b8).((CgreenBreadcrumbcxx . . $ CgreenBreadcrumb# *) reporter->breadcrumbcxx . . $ TestReporter_#breadcrumb.) == 0) { |
| 262 | if (!have_quiet_modecxx . . $ have_quiet_mode(a7dfc52e252d5ebe).(reporter) && !inhibit_finish_suite_messagecxx . . $ inhibit_finish_suite_message(a7dfc52e252d5ebe).(reporter)) { |
| 263 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(prepend, "Completed \"%s\": ", name); |
| 264 | text_reporter_print_resultscxx . . $ text_reporter_print_results(7e7a9f829799a73e).(buf, prepend, |
| 265 | reporter->total_passescxx . . $ TestReporter_#total_passes., |
| 266 | reporter->total_failurescxx . . $ TestReporter_#total_failures., |
| 267 | reporter->total_skipscxx . . $ TestReporter_#total_skips., |
| 268 | reporter->total_exceptionscxx . . $ TestReporter_#total_exceptions., |
| 269 | reporter->total_durationcxx . . $ TestReporter_#total_duration., |
| 270 | use_colors); |
| 271 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("%s.\n", buf); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | static void show_failcxx . . $ show_fail(fabf0cf23815ef65).(TestReportercxx . . $ TestReporter# *reporter, const char *file, int line, |
| 278 | const char *message, va_listcxx . . $ va_list# arguments) { |
| 279 | TextMemocxx . . $ TextMemo# *memo = (TextMemocxx . . $ TextMemo# *)reporter->memocxx . . $ TestReporter_#memo.; |
| 280 | if (have_quiet_modecxx . . $ have_quiet_mode(a7dfc52e252d5ebe).(reporter)) memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n"); |
| 281 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("%s:%d: ", file, line); |
| 282 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("Failure: "); |
| 283 | memo->depthcxx . . $ $anonymous_type_dc6cefad400bcc1f_0#depth. = 0; |
| 284 | walk_breadcrumbcxx . . $ walk_breadcrumb(e1235c45da9c923a).((CgreenBreadcrumbcxx . . $ CgreenBreadcrumb# *) reporter->breadcrumbcxx . . $ TestReporter_#breadcrumb., &show_breadcrumbcxx . . $ show_breadcrumb(4611f29f2f861a56)., memo); |
| 285 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n\t"); |
| 286 | // Simplify *printf statements for more robust cross-platform logging |
| 287 | if (message == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) { |
| 288 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("<FATAL: NULL for failure message>"); |
| 289 | } else { |
| 290 | memo->vprintercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#vprinter.(message, arguments); |
| 291 | } |
| 292 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n"); |
| 293 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n"); |
| 294 | fflushcxx . . $ fflush(89bc1efcdac0ca22).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 295 | } |
| 296 | |
| 297 | static void show_incompletecxx . . $ show_incomplete(fabf0cf23815ef65).(TestReportercxx . . $ TestReporter# *reporter, const char *file, int line, |
| 298 | const char *message, va_listcxx . . $ va_list# arguments) { |
| 299 | TextMemocxx . . $ TextMemo# *memo = (TextMemocxx . . $ TextMemo# *)reporter->memocxx . . $ TestReporter_#memo.; |
| 300 | |
| 301 | if (have_quiet_modecxx . . $ have_quiet_mode(a7dfc52e252d5ebe).(reporter)) |
| 302 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n"); /* To break line of "....." for error message parsing */ |
| 303 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("%s:%d: ", file, line); |
| 304 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("Exception: "); |
| 305 | |
| 306 | memo->depthcxx . . $ $anonymous_type_dc6cefad400bcc1f_0#depth. = 0; |
| 307 | walk_breadcrumbcxx . . $ walk_breadcrumb(e1235c45da9c923a).((CgreenBreadcrumbcxx . . $ CgreenBreadcrumb# *) reporter->breadcrumbcxx . . $ TestReporter_#breadcrumb., &show_breadcrumbcxx . . $ show_breadcrumb(4611f29f2f861a56)., |
| 308 | memo); |
| 309 | |
| 310 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n\t"); |
| 311 | if (message == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) { |
| 312 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("Test terminated unexpectedly, " |
| 313 | "likely from a non-standard exception or Posix signal"); |
| 314 | } else { |
| 315 | memo->vprintercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#vprinter.(message, arguments); |
| 316 | } |
| 317 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n"); |
| 318 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("\n"); |
| 319 | fflushcxx . . $ fflush(89bc1efcdac0ca22).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 320 | } |
| 321 | |
| 322 | static void show_breadcrumbcxx . . $ show_breadcrumb(4611f29f2f861a56).(const char *name, void *memo_ptr) { |
| 323 | TextMemocxx . . $ TextMemo# *memo = (TextMemocxx . . $ TextMemo# *)memo_ptr; |
| 324 | if (memo->depthcxx . . $ $anonymous_type_dc6cefad400bcc1f_0#depth. > 1) { |
| 325 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("-> "); |
| 326 | } |
| 327 | if (memo->depthcxx . . $ $anonymous_type_dc6cefad400bcc1f_0#depth. > 0) { |
| 328 | memo->printercxx . . $ $anonymous_type_dc6cefad400bcc1f_0#printer.("%s ", name); |
| 329 | } |
| 330 | memo->depthcxx . . $ $anonymous_type_dc6cefad400bcc1f_0#depth.++; |
| 331 | } |
| 332 | |
| 333 | /* vim: set ts=4 sw=4 et cindent: */ |
| 334 | /* Local variables: */ |
| 335 | /* tab-width: 4 */ |
| 336 | /* End: */ |