From 3e959a33f972bdc48cced73e8f76eb9ce7ce64eb Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 11 Nov 2004 19:47:55 +0000 Subject: 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. --- tools/regression/lib/libc/stdlib/test-heapsort.c | 3 ++- tools/regression/lib/libc/stdlib/test-heapsort.t | 10 ++++++++++ tools/regression/lib/libc/stdlib/test-mergesort.c | 3 ++- tools/regression/lib/libc/stdlib/test-mergesort.t | 10 ++++++++++ tools/regression/lib/libc/stdlib/test-qsort.c | 3 ++- tools/regression/lib/libc/stdlib/test-qsort.t | 10 ++++++++++ 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 tools/regression/lib/libc/stdlib/test-heapsort.t create mode 100644 tools/regression/lib/libc/stdlib/test-mergesort.t create mode 100644 tools/regression/lib/libc/stdlib/test-qsort.t (limited to 'tools/regression/lib/libc/stdlib') diff --git a/tools/regression/lib/libc/stdlib/test-heapsort.c b/tools/regression/lib/libc/stdlib/test-heapsort.c index ad6dc89..6ce8924 100644 --- a/tools/regression/lib/libc/stdlib/test-heapsort.c +++ b/tools/regression/lib/libc/stdlib/test-heapsort.c @@ -44,6 +44,7 @@ main(int argc, char *argv[]) int testvector[IVEC_LEN]; int sresvector[IVEC_LEN]; + printf("1..1\n"); for (j = 2; j < IVEC_LEN; j++) { /* Populate test vectors */ for (i = 0; i < j; i++) @@ -59,7 +60,7 @@ main(int argc, char *argv[]) assert(testvector[i] == sresvector[i]); } - printf("PASS heapsort\n"); + printf("ok 1 - heapsort\n"); return(0); } diff --git a/tools/regression/lib/libc/stdlib/test-heapsort.t b/tools/regression/lib/libc/stdlib/test-heapsort.t new file mode 100644 index 0000000..8bdfd03 --- /dev/null +++ b/tools/regression/lib/libc/stdlib/test-heapsort.t @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable diff --git a/tools/regression/lib/libc/stdlib/test-mergesort.c b/tools/regression/lib/libc/stdlib/test-mergesort.c index c9817ca..729d481 100644 --- a/tools/regression/lib/libc/stdlib/test-mergesort.c +++ b/tools/regression/lib/libc/stdlib/test-mergesort.c @@ -44,6 +44,7 @@ main(int argc, char *argv[]) int testvector[IVEC_LEN]; int sresvector[IVEC_LEN]; + printf("1..1\n"); for (j = 2; j < IVEC_LEN; j++) { /* Populate test vectors */ for (i = 0; i < j; i++) @@ -59,7 +60,7 @@ main(int argc, char *argv[]) assert(testvector[i] == sresvector[i]); } - printf("PASS mergesort\n"); + printf("ok 1 - mergesort\n"); return(0); } diff --git a/tools/regression/lib/libc/stdlib/test-mergesort.t b/tools/regression/lib/libc/stdlib/test-mergesort.t new file mode 100644 index 0000000..8bdfd03 --- /dev/null +++ b/tools/regression/lib/libc/stdlib/test-mergesort.t @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable diff --git a/tools/regression/lib/libc/stdlib/test-qsort.c b/tools/regression/lib/libc/stdlib/test-qsort.c index 8002549..8a508e8 100644 --- a/tools/regression/lib/libc/stdlib/test-qsort.c +++ b/tools/regression/lib/libc/stdlib/test-qsort.c @@ -44,6 +44,7 @@ main(int argc, char *argv[]) int testvector[IVEC_LEN]; int sresvector[IVEC_LEN]; + printf("1..1\n"); for (j = 2; j < IVEC_LEN; j++) { /* Populate test vectors */ for (i = 0; i < j; i++) @@ -59,7 +60,7 @@ main(int argc, char *argv[]) assert(testvector[i] == sresvector[i]); } - printf("PASS qsort\n"); + printf("ok 1 - qsort\n"); return(0); } diff --git a/tools/regression/lib/libc/stdlib/test-qsort.t b/tools/regression/lib/libc/stdlib/test-qsort.t new file mode 100644 index 0000000..8bdfd03 --- /dev/null +++ b/tools/regression/lib/libc/stdlib/test-qsort.t @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable -- cgit v1.1