File src/stic.c changed (mode: 100644) (index 2433c83..3eb199d) |
... |
... |
static int stic_fixture_tests_failed; |
158 |
158 |
|
|
159 |
159 |
void stic_simple_test_result_log(int passed, char* reason, const char* function, const char file[], unsigned int line) |
void stic_simple_test_result_log(int passed, char* reason, const char* function, const char file[], unsigned int line) |
160 |
160 |
{ |
{ |
161 |
|
/* TODO: do use function if it differs from test. */ |
|
162 |
|
(void)function; |
|
|
161 |
|
if (stic_current_test != NULL && strcmp(function, stic_current_test) == 0) |
|
162 |
|
{ |
|
163 |
|
function = "test body"; |
|
164 |
|
} |
163 |
165 |
|
|
164 |
166 |
if (stic_random_failures && random() % 8 == 0) |
if (stic_random_failures && random() % 8 == 0) |
165 |
167 |
{ |
{ |
|
... |
... |
void stic_simple_test_result_log(int passed, char* reason, const char* function, |
170 |
172 |
{ |
{ |
171 |
173 |
if(stic_machine_readable) |
if(stic_machine_readable) |
172 |
174 |
{ |
{ |
173 |
|
printf("%s%s,%s,%u,%s\n", stic_magic_marker, stic_current_fixture_path, stic_current_test, line, reason ); |
|
|
175 |
|
printf("%s%s,%s,%u,%s\n", stic_magic_marker, stic_current_fixture_path, stic_current_test, line, reason); |
174 |
176 |
} |
} |
175 |
177 |
else |
else |
176 |
178 |
{ |
{ |
177 |
|
printf("%-30s Line %-5u %s\n", stic_current_test, line, reason ); |
|
|
179 |
|
printf("\n%s:\n", stic_current_test); |
|
180 |
|
printf(" (-) %s:%u\n in %s\n %s\n", |
|
181 |
|
file, line, function, reason ); |
178 |
182 |
} |
} |
179 |
183 |
sea_tests_failed++; |
sea_tests_failed++; |
180 |
184 |
} |
} |
|
... |
... |
void stic_simple_test_result_log(int passed, char* reason, const char* function, |
184 |
188 |
{ |
{ |
185 |
189 |
if(stic_machine_readable) |
if(stic_machine_readable) |
186 |
190 |
{ |
{ |
187 |
|
printf("%s%s,%s,%u,Passed\n", stic_magic_marker, stic_current_fixture_path, stic_current_test, line ); |
|
|
191 |
|
printf("%s%s,%s,%u,Passed\n", stic_magic_marker, stic_current_fixture_path, stic_current_test, line); |
188 |
192 |
} |
} |
189 |
193 |
else |
else |
190 |
194 |
{ |
{ |
191 |
|
printf("%-30s Line %-5u Passed\n", stic_current_test, line); |
|
|
195 |
|
printf("\n%s\n", stic_current_test); |
|
196 |
|
printf(" (+) %s:%u\n in %s\n", file, line, function); |
192 |
197 |
} |
} |
193 |
198 |
} |
} |
194 |
199 |
sea_tests_passed++; |
sea_tests_passed++; |