summaryrefslogtreecommitdiff
path: root/regress/tools/files/awk-test.sh
diff options
context:
space:
mode:
authorrillig <rillig>2005-11-19 22:03:54 +0000
committerrillig <rillig>2005-11-19 22:03:54 +0000
commit91ec02ce89aea1cc2a71c78ea920c7430c430cd4 (patch)
treeee7ca87e99f182ba2ebe5371ff0a4dc63258a862 /regress/tools/files/awk-test.sh
parent4e4b91033d4d13a6849ec7f0bad25da2b79aa50c (diff)
downloadpkgsrc-91ec02ce89aea1cc2a71c78ea920c7430c430cd4.tar.gz
Print the name of the test case when starting it. This helps in detecting
which test case fails.
Diffstat (limited to 'regress/tools/files/awk-test.sh')
-rw-r--r--regress/tools/files/awk-test.sh9
1 files changed, 8 insertions, 1 deletions
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