diff options
author | Nicolas Williams <nico@cryptonector.com> | 2013-06-15 01:55:47 -0500 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2013-06-15 17:37:15 -0500 |
commit | 0ed6347d47e68c0bba4b93fae9028e84ec64b4b6 (patch) | |
tree | 558b5827137ac7346cca6b7e54382cef240881b9 /jq_test.c | |
parent | 3f86e97f709d222fc79f4e7b096af40782ea8775 (diff) |
Allow --run-tests to take a file argument
Diffstat (limited to 'jq_test.c')
-rw-r--r-- | jq_test.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -10,8 +10,16 @@ static void run_jq_tests(); int jq_testsuite(int argc, char* argv[]) { + FILE *testdata = stdin; jv_test(); - run_jq_tests(stdin); + if (argc > 2) { + testdata = fopen(argv[2], "re"); + if (!testdata) { + perror("fopen"); + exit(1); + } + } + run_jq_tests(testdata); return 0; } |