summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorgavan <gavan@pkgsrc.org>2004-08-28 00:19:17 +0000
committergavan <gavan@pkgsrc.org>2004-08-28 00:19:17 +0000
commit27dc9f9dd9cdd4b6ef0464812a2831b2ad280596 (patch)
tree484cfb84d22f02bf9aba4c0f535a30132066a97e /regress
parent4c1617492939474180a8064ab0a9669c4f8a75bc (diff)
downloadpkgsrc-27dc9f9dd9cdd4b6ef0464812a2831b2ad280596.tar.gz
Add pkgfail, a simple regression test which ensures that PKG_FAIL_REASON works.
This test serves as a simple example of how to write a regression test.
Diffstat (limited to 'regress')
-rw-r--r--regress/Makefile3
-rw-r--r--regress/pkgfail/Makefile12
-rw-r--r--regress/pkgfail/spec52
3 files changed, 66 insertions, 1 deletions
diff --git a/regress/Makefile b/regress/Makefile
index c813edf66c7..5950de94ff0 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2004/08/27 21:35:21 jlam Exp $
+# $NetBSD: Makefile,v 1.3 2004/08/28 00:19:17 gavan Exp $
COMMENT= Regression tests for pkgsrc infrastructure
SUBDIR+= buildlink-transform
+SUBDIR+= pkgfail
.include "../mk/bsd.pkg.subdir.mk"
diff --git a/regress/pkgfail/Makefile b/regress/pkgfail/Makefile
new file mode 100644
index 00000000000..f8b7bf82769
--- /dev/null
+++ b/regress/pkgfail/Makefile
@@ -0,0 +1,12 @@
+# $NetBSD: Makefile,v 1.1 2004/08/28 00:19:17 gavan Exp $
+#
+
+DISTNAME= regress-pkgfail-0.0
+CATEGORIES= regress
+
+MAINTAINER= gavan@NetBSD.org
+COMMENT= Test PKG_FAIL_REASON
+
+PKG_FAIL_REASON= "This package should never build"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/regress/pkgfail/spec b/regress/pkgfail/spec
new file mode 100644
index 00000000000..bc6d153a834
--- /dev/null
+++ b/regress/pkgfail/spec
@@ -0,0 +1,52 @@
+# pkgfail regression test
+# spec file
+#
+# A spec file is sourced by the pkg_regress script. The following variables
+# control the basic aspects of the individual test.
+#
+# Variables starting TEST_ are reserved, and should not be used in this file.
+#
+
+# MAKEARGS_TEST is the make target(s) and any extra arguments to invoke make
+# in the regression testing directory. If empty, make will be invoked with
+# no arguments.
+
+MAKEARGS_TEST=install
+
+# MAKEARGS_CLEAN is the make target(s) and any extra arguments to invoke make
+# in the regression testing directory in order to clean up. This is the final
+# step which is taken, and occurs after the determination of pass/fail for
+# the test. A typical value for this variable may be "deinstall clean".
+# This variable is optional.
+
+#MAKEARGS_CLEAN=
+
+
+check_result()
+{
+# exit_status compares its argument against the exit status from make. If not
+# the same, the test is failed.
+
+exit_status 1
+
+# output_require passes a list of patterns to egrep to check for in the output
+# from the make invocation. If any pattern is not matched, the test is failed.
+
+output_require "This package should never build"
+
+# output_prohibit passes a list of patterns to egrep to check for in the output
+# from the make invocation. If any pattern is matched, the test is failed.
+
+# output_prohibit ""
+
+}
+
+
+# Environment variables may be set here to be passed to subprocesses such as
+# make.
+
+#export VARIABLE=value
+
+# Other scripting that may be required prior to execution of the test may
+# be placed here. Please note that if possible, logic should be confined
+# to the Makefile and not placed here.