pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/regress/tools Regression test for the capabilities of ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/739cd7e99555
branches: trunk
changeset: 503400:739cd7e99555
user: rillig <rillig%pkgsrc.org@localhost>
date: Sat Nov 19 21:27:06 2005 +0000
description:
Regression test for the capabilities of the TOOLS. Most of them have
many different implementations and are by no way easy to use. This test
collects some assumptions about what the tools must be able to handle.
It is also meant as a guide on using these tools correctly and reliably.
diffstat:
regress/tools/Makefile | 22 ++++++++++++++++++++++
regress/tools/files/awk-test.sh | 23 +++++++++++++++++++++++
regress/tools/spec | 8 ++++++++
3 files changed, 53 insertions(+), 0 deletions(-)
diffs (65 lines):
diff -r 9ba562b8a2d2 -r 739cd7e99555 regress/tools/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/tools/Makefile Sat Nov 19 21:27:06 2005 +0000
@@ -0,0 +1,22 @@
+# $NetBSD: Makefile,v 1.1.1.1 2005/11/19 21:27:06 rillig Exp $
+#
+
+DISTNAME= regress-tools-1.0
+CATEGORIES= regress
+DISTFILES= # empty
+
+MAINTAINER= rillig%NetBSD.org@localhost
+COMMENT= Test whether the TOOLS do what I expect
+
+WRKSRC= ${WRKDIR}
+REGRESS_TESTS= awk
+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}; \
+ ${SH} ${FILESDIR:Q}/${t:Q}-test.sh
+.endfor
+
+.include "../../mk/bsd.pkg.mk"
diff -r 9ba562b8a2d2 -r 739cd7e99555 regress/tools/files/awk-test.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/tools/files/awk-test.sh Sat Nov 19 21:27:06 2005 +0000
@@ -0,0 +1,23 @@
+#! /bin/sh
+# $NetBSD: awk-test.sh,v 1.1.1.1 2005/11/19 21:27:06 rillig Exp $
+#
+
+set -e
+
+assert_equal() {
+ case $1 in
+ "$2") ;;
+ *) echo "[assert_equal] expected \"$1\", got \"$2\"." 1>&2
+ exit 1;;
+ esac
+}
+
+# usage: test_assignment <input> <expected-output>
+test_assignment() {
+ o=`echo "" | awk '{print var}' var="$1"`
+ assert_equal "$2" "${o}"
+}
+
+test_assignment "foo" "foo"
+test_assignment "foo bar baz" "foo bar baz"
+test_assignment "CPPFLAGS=\\\"-Dfoo=bar\\\"" "CPPFLAGS=\"-Dfoo=bar\""
diff -r 9ba562b8a2d2 -r 739cd7e99555 regress/tools/spec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/tools/spec Sat Nov 19 21:27:06 2005 +0000
@@ -0,0 +1,8 @@
+# $NetBSD: spec,v 1.1.1.1 2005/11/19 21:27:06 rillig Exp $
+#
+
+MAKEARGS_CLEAN="clean"
+
+check_result() {
+ exit_status 0
+}
Home |
Main Index |
Thread Index |
Old Index