diff options
author | nik <nik@FreeBSD.org> | 2004-11-11 19:47:55 +0000 |
---|---|---|
committer | nik <nik@FreeBSD.org> | 2004-11-11 19:47:55 +0000 |
commit | 3e959a33f972bdc48cced73e8f76eb9ce7ce64eb (patch) | |
tree | cfebca4a0526247931bc6bdde73f15f72f3e92d0 /tools/regression/lib/libc/net/test-eui64_line.c | |
parent | 6e5bd296a6ca375161a672ed141aa5e414ffbc16 (diff) | |
download | FreeBSD-src-3e959a33f972bdc48cced73e8f76eb9ce7ce64eb.zip FreeBSD-src-3e959a33f972bdc48cced73e8f76eb9ce7ce64eb.tar.gz |
Switch over to a different, more flexible test output protocol that's
understood by Perl's Test::Harness module and prove(1) commands.
Update README to describe the new protocol. The work's broken down into
two main sets of changes.
First, update the existing test programs (shell scripts and C programs)
to produce output in the ok/not ok format, and to, where possible, also
produce a header describing the number of tests that are expected to be
run.
Second, provide the .t files that actually run the tests. In some cases
these are copies of, or very similar too, scripts that already existed.
I've kept the old scripts around so that it's possible to verify that
behaviour under this new system (in terms of whether or not a test fails)
is identical to the behaviour under the old system.
Add a TODO file.
Diffstat (limited to 'tools/regression/lib/libc/net/test-eui64_line.c')
-rw-r--r-- | tools/regression/lib/libc/net/test-eui64_line.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/regression/lib/libc/net/test-eui64_line.c b/tools/regression/lib/libc/net/test-eui64_line.c index 463042a..714b460 100644 --- a/tools/regression/lib/libc/net/test-eui64_line.c +++ b/tools/regression/lib/libc/net/test-eui64_line.c @@ -40,17 +40,20 @@ test_line(const char *line, const struct eui64 *eui, const char *host) { struct eui64 e; char buf[256]; + static int test = 0; + + test++; if (eui64_line(line, &e, buf, sizeof(buf)) != 0 || memcmp(&e, eui, sizeof(struct eui64)) != 0 || strcmp(buf, host) != 0) { - printf("FAIL: eui64_line(\"%s\")\n", line); - printf("host = %s\n", buf); + printf("not ok %d - eui64_line(\"%s\")\n", test, line); + printf("# host = %s\n", buf); eui64_ntoa(&e, buf, sizeof(buf)); - printf("e = %s\n", buf); + printf("# e = %s\n", buf); return (0); } else { - printf("PASS: eui64_line(\"%s\")\n", line); + printf("ok %d - eui64_line(\"%s\")\n", test, line); return (1); } } @@ -59,6 +62,8 @@ int main(int argc, char **argv) { + printf("1..6\n"); + test_line(test_eui64_line_id, &test_eui64_id, test_eui64_id_host); test_line(test_eui64_line_id_colon, &test_eui64_id, |