summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLawrence Teo <lteo@cvs.openbsd.org>2014-03-20 04:00:35 +0000
committerLawrence Teo <lteo@cvs.openbsd.org>2014-03-20 04:00:35 +0000
commite38d5157b972f6546f75b979adffb4cdc37d6abd (patch)
treeabe5222765b530970074e0ce50a96fed386e7fed
parent82ffb78d0d9b48c4a1768308325516684674e21e (diff)
Basic tests for ps(1) to check for valid/invalid keywords
-rw-r--r--regress/bin/ps/Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/regress/bin/ps/Makefile b/regress/bin/ps/Makefile
new file mode 100644
index 00000000000..a3a90266a7e
--- /dev/null
+++ b/regress/bin/ps/Makefile
@@ -0,0 +1,16 @@
+# $OpenBSD: Makefile,v 1.1 2014/03/20 04:00:34 lteo Exp $
+
+REGRESS_TARGETS= valid_keywords invalid_keywords
+
+# This test ensures that ps(1) will actually accept the keywords it claims to
+# accept, and that the list of keywords in ps/keyword.c are in ascending order
+# (which is required by the bsearch(3)-based keyword lookup code)
+valid_keywords:
+ ps -o "$$(ps -L)" >/dev/null
+
+invalid_keywords:
+ if ps -o "bogus" >/dev/null 2>&1; then \
+ false; \
+ fi
+
+.include <bsd.regress.mk>