Skip to content

Commit

Permalink
[tests] print test # from the start of the tests file to help with sk…
Browse files Browse the repository at this point in the history
…ip and take
  • Loading branch information
Leonid S. Usov authored and wtlangford committed Oct 22, 2019
1 parent cf4b48c commit 4860ed4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jq_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void run_jq_tests(jv lib_dirs, int verbose, FILE *testdata, int skip, int
int check_msg = 0;
jq_state *jq = NULL;

int tests_to_skip = skip;
int tests_to_skip = skip > 0 ? skip : 0;
int tests_to_take = take;

jq = jq_init();
Expand Down Expand Up @@ -123,9 +123,9 @@ static void run_jq_tests(jv lib_dirs, int verbose, FILE *testdata, int skip, int
break;
}

printf("Testing '%s' at line number %u\n", prog, lineno);
int pass = 1;
tests++;
printf("Test #%d: '%s' at line number %u\n", tests + tests_to_skip, prog, lineno);
int compiled = jq_compile(jq, prog);

if (must_fail) {
Expand Down Expand Up @@ -223,7 +223,7 @@ static void run_jq_tests(jv lib_dirs, int verbose, FILE *testdata, int skip, int
}
jq_teardown(&jq);

int total_skipped = tests_to_skip > 0 ? tests_to_skip : 0;
int total_skipped = tests_to_skip;

if (skip > 0) {
total_skipped = tests_to_skip - skip;
Expand Down

0 comments on commit 4860ed4

Please sign in to comment.