From 28cc57e2f62d5bb0407372b26f74201c41f3421c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 5 Oct 2011 10:33:41 +0200 Subject: [PATCH] Add --enable-coverage to tesh self-tests. --- tools/tesh/IO-orders.tesh | 18 ++++++++++++------ tools/tesh/catch-return.tesh | 3 ++- tools/tesh/catch-signal.tesh | 3 ++- tools/tesh/catch-timeout.tesh | 3 ++- tools/tesh/catch-wrong-output.tesh | 3 ++- tools/tesh/cd.tesh | 3 ++- tools/tesh/set-ignore-output.tesh | 3 ++- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/tools/tesh/IO-orders.tesh b/tools/tesh/IO-orders.tesh index 14db63d9b5..79483162fe 100644 --- a/tools/tesh/IO-orders.tesh +++ b/tools/tesh/IO-orders.tesh @@ -5,53 +5,59 @@ p Order: in, out, cmd < < TOTO < > TOTO < $ cat +> Enable coverage > Test suite from stdin > [(stdin):3] cat > Test suite from stdin OK -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' p Order: out, in, cmd < > TOTO < < TOTO < $ cat +> Enable coverage > Test suite from stdin > [(stdin):3] cat > Test suite from stdin OK -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' p Order: out, cmd, in < > TOTO < $ cat < < TOTO +> Enable coverage > Test suite from stdin > [(stdin):2] cat > Test suite from stdin OK -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' p Order: in, cmd, out < < TOTO < $ cat < > TOTO +> Enable coverage > Test suite from stdin > [(stdin):2] cat > Test suite from stdin OK -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' p Order: cmd, out, in < $ cat < > TOTO < < TOTO +> Enable coverage > Test suite from stdin > [(stdin):1] cat > Test suite from stdin OK -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' p Order: cmd, in, out < $ cat < < TOTO < > TOTO +> Enable coverage > Test suite from stdin > [(stdin):1] cat > Test suite from stdin OK -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' diff --git a/tools/tesh/catch-return.tesh b/tools/tesh/catch-return.tesh index b7d39c592d..94bf5c854e 100644 --- a/tools/tesh/catch-return.tesh +++ b/tools/tesh/catch-return.tesh @@ -16,7 +16,8 @@ $ gcc -o return1 return1.c ! expect return 41 < $ ./return1 -$ ../tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ../tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' +> Enable coverage > Test suite from stdin > [(stdin):1] ./return1 > Test suite `(stdin)': NOK (<(stdin):1> returned code 1) diff --git a/tools/tesh/catch-signal.tesh b/tools/tesh/catch-signal.tesh index 2b0436f2aa..7cde9813b1 100644 --- a/tools/tesh/catch-signal.tesh +++ b/tools/tesh/catch-signal.tesh @@ -17,7 +17,8 @@ $ gcc -o segfault segfault.c ! expect return 15 < $ ./segfault -$ ../tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ../tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' +> Enable coverage > Test suite from stdin > [(stdin):1] ./segfault > Test suite `(stdin)': NOK (<(stdin):1> got signal SIGSEGV) diff --git a/tools/tesh/catch-timeout.tesh b/tools/tesh/catch-timeout.tesh index ebab52a61d..d9daf92e95 100644 --- a/tools/tesh/catch-timeout.tesh +++ b/tools/tesh/catch-timeout.tesh @@ -6,9 +6,10 @@ ! expect return 3 < ! timeout 1 < $ sleep 6 +> Enable coverage > Test suite from stdin > [(stdin):2] sleep 6 > <(stdin):2> timeouted. Kill the process. > <(stdin):2> No output before timeout > Test suite `(stdin)': NOK (<(stdin):2> timeout after 1 sec) -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' diff --git a/tools/tesh/catch-wrong-output.tesh b/tools/tesh/catch-wrong-output.tesh index 135ae4cbfa..bfb2adbf98 100644 --- a/tools/tesh/catch-wrong-output.tesh +++ b/tools/tesh/catch-wrong-output.tesh @@ -6,7 +6,8 @@ p This tests whether TESH detects wrong outputs < > TOTO < < TUTU < $ cat -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' +> Enable coverage > Test suite from stdin > [(stdin):3] cat > Output of <(stdin):3> mismatch: diff --git a/tools/tesh/cd.tesh b/tools/tesh/cd.tesh index 221ea43715..807086412a 100644 --- a/tools/tesh/cd.tesh +++ b/tools/tesh/cd.tesh @@ -12,10 +12,11 @@ $ ls # Check that tesh detects properly cd to non-existing directories ! expect return 4 < $ cd toto +> Enable coverage > Test suite from stdin > Chdir to toto failed: No such file or directory > Test suite `(stdin)': NOK (system error) -$ ../tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ../tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' # The next command checks that there is a testdir_temp-cd in the upper directory, # ie that mkdir and cd both worked. diff --git a/tools/tesh/set-ignore-output.tesh b/tools/tesh/set-ignore-output.tesh index af80e581e4..1fba40114d 100644 --- a/tools/tesh/set-ignore-output.tesh +++ b/tools/tesh/set-ignore-output.tesh @@ -6,7 +6,8 @@ p This tests whether TESH accepts to ignore command output < > TOTO < < TUTU < $ cat -$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +$ ./tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' +> Enable coverage > Test suite from stdin > [(stdin):4] cat > (ignoring the output of <(stdin):4> as requested) -- 2.20.1