summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2004-02-21 19:07:29 +0000
committerespie <espie@openbsd.org>2004-02-21 19:07:29 +0000
commit7aaed1c4d3ebeb37d56623213ed83ce779047e23 (patch)
tree70546ee857d0766095f7e36cc4944752c0aa564d
parentkeep O_NONBLOCK after teh tcp sessions are established, claudio ok (diff)
downloadwireguard-openbsd-7aaed1c4d3ebeb37d56623213ed83ce779047e23.tar.xz
wireguard-openbsd-7aaed1c4d3ebeb37d56623213ed83ce779047e23.zip
First regression test for pkg_add, checking packages-specs lists.
(the nice thing about having this as perl modules is that we CAN write regression tests)
-rw-r--r--regress/Makefile4
-rw-r--r--regress/usr.sbin/Makefile5
-rw-r--r--regress/usr.sbin/pkg_add/Makefile10
-rw-r--r--regress/usr.sbin/pkg_add/check-name11
4 files changed, 28 insertions, 2 deletions
diff --git a/regress/Makefile b/regress/Makefile
index 51102ab3ebf..883241557f0 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.16 2002/12/04 05:03:02 art Exp $
+# $OpenBSD: Makefile,v 1.17 2004/02/21 19:07:29 espie Exp $
#
# To run full regression tests you just need two steps:
@@ -15,7 +15,7 @@
# email address, preferably 'regress@openbsd.org'.
# To skip the really slow tests, set the REGRESS_SKIP_SLOW variable.
-SUBDIR+= etc bin include lib libexec sbin sys share usr.bin misc
+SUBDIR+= etc bin include lib libexec sbin sys share usr.bin usr.sbin misc
install:
diff --git a/regress/usr.sbin/Makefile b/regress/usr.sbin/Makefile
new file mode 100644
index 00000000000..662362d6c7d
--- /dev/null
+++ b/regress/usr.sbin/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2004/02/21 19:07:29 espie Exp $
+
+SUBDIR+= pkg_add
+
+.include <bsd.subdir.mk>
diff --git a/regress/usr.sbin/pkg_add/Makefile b/regress/usr.sbin/pkg_add/Makefile
new file mode 100644
index 00000000000..a27c7318a22
--- /dev/null
+++ b/regress/usr.sbin/pkg_add/Makefile
@@ -0,0 +1,10 @@
+# $OpenBSD: Makefile,v 1.1 2004/02/21 19:07:29 espie Exp $
+
+REGRESS_TARGETS=pkgnames
+
+pkgnames:
+ perl check-name
+
+.PHONY: pkgnames
+
+.include <bsd.regress.mk>
diff --git a/regress/usr.sbin/pkg_add/check-name b/regress/usr.sbin/pkg_add/check-name
new file mode 100644
index 00000000000..0f9fe003acb
--- /dev/null
+++ b/regress/usr.sbin/pkg_add/check-name
@@ -0,0 +1,11 @@
+#! /usr/bin/perl
+# $OpenBSD: check-name,v 1.1 2004/02/21 19:07:29 espie Exp $
+# Written by Marc Espie
+# Public domain
+
+use Test::Simple tests => 1;
+use OpenBSD::PackageName;
+
+my @list=qw(py-MxDateTime-2.0.1-py2.1);
+
+ok(OpenBSD::PackageName::pkgspec_match('py-MxDateTime->=2.0-py2.1', @list) == 1);