pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/regress/tools Print the name of the test case when sta...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3a89b94ca0b9
branches:  trunk
changeset: 503404:3a89b94ca0b9
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Nov 19 22:03:54 2005 +0000

description:
Print the name of the test case when starting it. This helps in detecting
which test case fails.

diffstat:

 regress/tools/Makefile          |  4 ++--
 regress/tools/files/awk-test.sh |  9 ++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diffs (52 lines):

diff -r 7fe7a3dcc40e -r 3a89b94ca0b9 regress/tools/Makefile
--- a/regress/tools/Makefile    Sat Nov 19 21:59:51 2005 +0000
+++ b/regress/tools/Makefile    Sat Nov 19 22:03:54 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.1.1 2005/11/19 21:27:06 rillig Exp $
+# $NetBSD: Makefile,v 1.2 2005/11/19 22:03:54 rillig Exp $
 #
 
 DISTNAME=      regress-tools-1.0
@@ -15,7 +15,7 @@
 do-build:
 .for t in ${REGRESS_TESTS}
        @${_PKG_SILENT}${_PKG_DEBUG}set -e; cd ${WRKSRC:Q};             \
-       ${ECHO_MSG} "Running testcase "${t:Q};                          \
+       ${ECHO_MSG} "Running testsuite "${t:Q};                         \
        ${SH} ${FILESDIR:Q}/${t:Q}-test.sh
 .endfor
 
diff -r 7fe7a3dcc40e -r 3a89b94ca0b9 regress/tools/files/awk-test.sh
--- a/regress/tools/files/awk-test.sh   Sat Nov 19 21:59:51 2005 +0000
+++ b/regress/tools/files/awk-test.sh   Sat Nov 19 22:03:54 2005 +0000
@@ -1,9 +1,14 @@
 #! /bin/sh
-# $NetBSD: awk-test.sh,v 1.3 2005/11/19 21:59:51 rillig Exp $
+# $NetBSD: awk-test.sh,v 1.4 2005/11/19 22:03:54 rillig Exp $
 #
 
 set -e
 
+# usage: testcase_start <testname>
+testcase_start() {
+       printf "Running testcase %s\\n" "$1"
+}
+
 # usage: assert_equal <testname> <expected> <got>
 assert_equal() {
        case $2 in
@@ -15,12 +20,14 @@
 
 # usage: test_assignment <testname> <input> <expected-output>
 test_assignment() {
+       testcase_start "$1"
        o=`echo "" | awk '{print var}' var="$2"`
        assert_equal "$1" "$3" "${o}"
 }
 
 # usage: test_passline <testname> <input>
 test_passline() {
+       testcase_start "$1"
        o=`awk '{print}' <<EOF
 $2
 EOF



Home | Main Index | Thread Index | Old Index