diff options
author | Leonid S. Usov <leonid@practi.net> | 2018-10-30 14:51:49 +0200 |
---|---|---|
committer | William Langford <wlangfor@gmail.com> | 2019-04-03 22:20:31 -0400 |
commit | ccc3e1f401ac0663dd591e5a05d6ddbc79ef35f3 (patch) | |
tree | fcb0a62db753ac1d9427febcde5e7444a0077dd2 | |
parent | ff8924ce16e58f7a7545f42a4971e2dbd3804ab7 (diff) |
[tests] print test # from the start of the tests file to help with skip and take
-rw-r--r-- | src/jq_test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jq_test.c b/src/jq_test.c index 2b40d4d6..eed633f4 100644 --- a/src/jq_test.c +++ b/src/jq_test.c @@ -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(); @@ -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) { @@ -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; |