File src/stic.c changed (mode: 100644) (index c74cf25..e9354ce) |
9 |
9 |
|
|
10 |
10 |
#include <stdarg.h> |
#include <stdarg.h> |
11 |
11 |
#include <stdio.h> |
#include <stdio.h> |
|
12 |
|
#include <stdlib.h> |
12 |
13 |
#include <string.h> |
#include <string.h> |
13 |
14 |
#include <wchar.h> |
#include <wchar.h> |
14 |
15 |
|
|
|
... |
... |
static int sea_tests_passed = 0; |
73 |
74 |
static int sea_tests_failed = 0; |
static int sea_tests_failed = 0; |
74 |
75 |
static int stic_display_only = 0; |
static int stic_display_only = 0; |
75 |
76 |
static int stic_verbose = 0; |
static int stic_verbose = 0; |
|
77 |
|
static int stic_random_failures = 0; |
76 |
78 |
static int stic_machine_readable = 0; |
static int stic_machine_readable = 0; |
77 |
79 |
static const char *stic_current_fixture; |
static const char *stic_current_fixture; |
78 |
80 |
static const char *stic_current_fixture_path; |
static const char *stic_current_fixture_path; |
|
... |
... |
void stic_simple_test_result_log(int passed, char* reason, const char* function, |
159 |
161 |
/* TODO: do use function if it differs from test. */ |
/* TODO: do use function if it differs from test. */ |
160 |
162 |
(void)function; |
(void)function; |
161 |
163 |
|
|
|
164 |
|
if (stic_random_failures && random() % 8 == 0) |
|
165 |
|
{ |
|
166 |
|
passed = !passed; |
|
167 |
|
} |
|
168 |
|
|
162 |
169 |
if (!passed) |
if (!passed) |
163 |
170 |
{ |
{ |
164 |
171 |
if(stic_machine_readable) |
if(stic_machine_readable) |
|
... |
... |
void stic_show_help( void ) |
478 |
485 |
printf("\t-f:\twill only run fixtures that match <fixturename>\n"); |
printf("\t-f:\twill only run fixtures that match <fixturename>\n"); |
479 |
486 |
printf("\t-d:\twill just display test names and fixtures without\n"); |
printf("\t-d:\twill just display test names and fixtures without\n"); |
480 |
487 |
printf("\t-d:\trunning the test\n"); |
printf("\t-d:\trunning the test\n"); |
|
488 |
|
printf("\t-r:\tproduce random failures\n"); |
481 |
489 |
printf("\t-v:\twill print a more verbose version of the test run\n"); |
printf("\t-v:\twill print a more verbose version of the test run\n"); |
482 |
490 |
printf("\t-m:\twill print a machine readable format of the test run, ie :- \n"); |
printf("\t-m:\twill print a machine readable format of the test run, ie :- \n"); |
483 |
491 |
printf("\t \t<textfixture>,<testname>,<linenumber>,<testresult><EOL>\n"); |
printf("\t \t<textfixture>,<testname>,<linenumber>,<testresult><EOL>\n"); |
|
... |
... |
void stic_interpret_commandline(stic_testrunner_t* runner) |
520 |
528 |
return; |
return; |
521 |
529 |
} |
} |
522 |
530 |
if(stic_is_string_equal_i(runner->argv[arg], "-d")) runner->action = STIC_DISPLAY_TESTS; |
if(stic_is_string_equal_i(runner->argv[arg], "-d")) runner->action = STIC_DISPLAY_TESTS; |
|
531 |
|
if(stic_is_string_equal_i(runner->argv[arg], "-r")) stic_random_failures = 1; |
523 |
532 |
if(stic_is_string_equal_i(runner->argv[arg], "-v")) stic_verbose = 1; |
if(stic_is_string_equal_i(runner->argv[arg], "-v")) stic_verbose = 1; |
524 |
533 |
if(stic_is_string_equal_i(runner->argv[arg], "-m")) stic_machine_readable = 1; |
if(stic_is_string_equal_i(runner->argv[arg], "-m")) stic_machine_readable = 1; |
525 |
534 |
if(stic_parse_commandline_option_with_value(runner,arg,"-t", test_filter)) arg++; |
if(stic_parse_commandline_option_with_value(runner,arg,"-t", test_filter)) arg++; |