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:
2021-10-10 21:51:38 +00:00
parent 470814f147
commit 843c53e15e
20 changed files with 2373 additions and 1110 deletions

View File

@ -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);