Clean up autotools config.

Remove some of @stagrlee's hard work since jq's testsuite is
less silly than when he wrote the autotools config.
This commit is contained in:
Stephen Dolan committed 2013-05-08 02:42:23 +01:00
1 parent 1ebb382540
commit d121420757
6 files changed
+55 -187

No files matched your search

+1 -29
View File
@@ -10,39 +10,11 @@ static void run_jq_tests();
int jq_testsuite(int argc, char* argv[]) {
FILE* testdata;
jv_test();
if (argc == 1) {
testdata = fopen("testdata", "r");
if ( NULL == testdata )
{
/* in an autoconf distcheck, the binary file will be in a _build subdirectory */
testdata = fopen("../testdata", "r");
if ( NULL == testdata )
{
fprintf(stderr, "Could not find testdata file\n");
exit(1);
}
}
} else if (argc == 2) {
if (!strcmp(argv[1], "-")) {
testdata = stdin;
} else {
testdata = fopen(argv[1], "r");
}
} else {
printf("usage: %s OR cat testdata | %s - OR %s testdata\n", argv[0], argv[0], argv[0]);
return 127;
}
run_jq_tests(testdata);
if (testdata != stdin) fclose(testdata);
run_jq_tests(stdin);
return 0;
}
static int skipline(const char* buf) {
int p = 0;
while (buf[p] == ' ' || buf[p] == '\t') p++;