forked from cory/tildefriends
I just decided. Braces on their own lines.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3668 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
12
src/tests.c
12
src/tests.c
@ -513,12 +513,15 @@ static void _test_file(const tf_test_options_t* options)
|
||||
static void _tf_test_run(const tf_test_options_t* options, const char* name, void (*test)(const tf_test_options_t* options))
|
||||
{
|
||||
bool specified = false;
|
||||
if (options->tests) {
|
||||
if (options->tests)
|
||||
{
|
||||
char* dup = strdup(options->tests);
|
||||
char* state = NULL;
|
||||
const char* t = NULL;
|
||||
while ((t = strtok_r(t ? NULL : dup, ",", &state)) != NULL) {
|
||||
if (strcmp(t, name) == 0) {
|
||||
while ((t = strtok_r(t ? NULL : dup, ",", &state)) != NULL)
|
||||
{
|
||||
if (strcmp(t, name) == 0)
|
||||
{
|
||||
specified = true;
|
||||
break;
|
||||
}
|
||||
@ -526,7 +529,8 @@ static void _tf_test_run(const tf_test_options_t* options, const char* name, voi
|
||||
free(dup);
|
||||
}
|
||||
|
||||
if (!options->tests || specified) {
|
||||
if (!options->tests || specified)
|
||||
{
|
||||
printf("Running test %s.\n", name);
|
||||
test(options);
|
||||
printf("[\e[1;32mpass\e[0m] %s\n", name);
|
||||
|
Reference in New Issue
Block a user