summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorrillig <rillig>2005-11-19 22:03:54 +0000
committerrillig <rillig>2005-11-19 22:03:54 +0000
commita0488d008660f327281d98128d676775f556bb23 (patch)
treeee7ca87e99f182ba2ebe5371ff0a4dc63258a862 /regress
parent05acf345dca980fec31b8ed9fda3117301831290 (diff)
downloadpkgsrc-a0488d008660f327281d98128d676775f556bb23.tar.gz
Print the name of the test case when starting it. This helps in detecting
which test case fails.
Diffstat (limited to 'regress')
-rw-r--r--regress/tools/Makefile4
-rw-r--r--regress/tools/files/awk-test.sh9
2 files changed, 10 insertions, 3 deletions
diff --git a/regress/tools/Makefile b/regress/tools/Makefile
index 40f247b462f..6f713a722d8 100644
--- a/regress/tools/Makefile
+++ b/regress/tools/Makefile
@@ -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 @@ USE_TOOLS+= awk
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 --git a/regress/tools/files/awk-test.sh b/regress/tools/files/awk-test.sh
index 8a04a39435c..07e3b3b2c28 100644
--- a/regress/tools/files/awk-test.sh
+++ b/regress/tools/files/awk-test.sh
@@ -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 @@ assert_equal() {
# 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