X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=t%2Fctap%2Fprove.c;h=7d1b8e2eaa37b172bf95240e26b3869017e3db0d;hb=69491d14441cfc893e18e1c60c13c995b93002c9;hp=1d870355b55602b191caad08e2dfb3e2bbfa0ea1;hpb=dc08462c5c1d2cb9ae52a7b1df98603cb1160262;p=zpackage diff --git a/t/ctap/prove.c b/t/ctap/prove.c index 1d87035..7d1b8e2 100644 --- a/t/ctap/prove.c +++ b/t/ctap/prove.c @@ -11,6 +11,7 @@ #include #define GREATER(x,y) ( ((x) > (y)) ? (x) : (y) ) +#define WARN(x) fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, x) struct result { int test; /* i.e. the number of the test */ @@ -56,7 +57,7 @@ int runone(struct testrun *run) { int pipefd[2]; pid_t cpid; FILE *tap; - char *line; + char *line = 0; ssize_t nread; size_t len = 0; int written = 0; @@ -87,6 +88,10 @@ int runone(struct testrun *run) { close(pipefd[1]); /* parent continue on */ tap = fdopen(pipefd[0], "r"); + if (tap == NULL) { + perror("tap is null:"); + exit(EXIT_FAILURE); + } } else { tap = stdin; } @@ -96,7 +101,7 @@ int runone(struct testrun *run) { regcomp(&plan, "^[[:digit:]]+\\.\\.([[:digit:]]+)", REG_EXTENDED); regcomp(&diagnostic, "#[[:space:]]*(.+)", REG_EXTENDED); - regcomp(&bail, "^Bail Out![[:space:]]*(.+)", REG_EXTENDED); + regcomp(&bail, "^Bail Out![[:space:]]*(.+)", REG_EXTENDED|REG_ICASE); regcomp(&version, "^TAP Version ([[:digit:]]+)", REG_EXTENDED); regcomp(&test, "^(not )?ok([[:space:]]*([[:digit:]]+))?", REG_EXTENDED);