Beispiel #1
0
Datei: tap.c Projekt: vehar/tomlc
void
tap_plan (int tests, const char *fmt, ...) {
    expected_tests = tests;
    if (tests == SKIP_ALL) {
        char *why;
        va_list args;
        va_start(args, fmt);
        why = vstrdupf(fmt, args);
        va_end(args);
        printf("1..0 ");
        note("SKIP %s\n", why);
        exit(0);
    }
    if (tests != NO_PLAN) {
        printf("1..%d\n", tests);
    }
}
Beispiel #2
0
static void
vdiag_to_fh (FILE *fh, const char *fmt, va_list args) {
    char *mesg, *line;
    int i;
    if (!fmt)
        return;
    mesg = vstrdupf(fmt, args);
    line = mesg;
    for (i = 0; *line; i++) {
        char c = mesg[i];
        if (!c || c == '\n') {
            mesg[i] = '\0';
            fprintf(fh, "# %s\n", line);
            if (!c) break;
            mesg[i] = c;
            line = &mesg[i+1];
        }
    }
    free(mesg);
    return;
}