summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-03-24 07:17:05 +0000
committerMike Frysinger <vapier@gentoo.org>2008-03-24 07:17:05 +0000
commit486d5176749922bf0eb1ffc7d99a4b1b62740be3 (patch)
tree11003906abc925aab4d6a900ededd2e430d8058a /sh
parent1c9c2f9fcffdc5d66af6e4b3dbf506985ebe438a (diff)
downloadopenrc-486d5176749922bf0eb1ffc7d99a4b1b62740be3.tar.gz
openrc-486d5176749922bf0eb1ffc7d99a4b1b62740be3.tar.bz2
openrc-486d5176749922bf0eb1ffc7d99a4b1b62740be3.tar.xz
setup a bit of a test framework
Diffstat (limited to 'sh')
-rw-r--r--sh/Makefile3
-rwxr-xr-xsh/runtests.sh25
2 files changed, 28 insertions, 0 deletions
diff --git a/sh/Makefile b/sh/Makefile
index bd55cbd..2f10ef5 100644
--- a/sh/Makefile
+++ b/sh/Makefile
@@ -18,3 +18,6 @@ _installafter:
@# Put functions.sh into the init.d dir so 3rd party apps don't have to
@# be multilib aware
ln -snf ${PREFIX}/${RC_LIB}/sh/functions.sh ${DESTDIR}/${PREFIX}/${INITDIR} || exit $$?
+
+check test::
+ ./runtests.sh
diff --git a/sh/runtests.sh b/sh/runtests.sh
new file mode 100755
index 0000000..d0d6a17
--- /dev/null
+++ b/sh/runtests.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+top_srcdir=${top_srcdir:-..}
+. ${top_srcdir}/test/setup_env.sh
+
+ret=0
+
+tret=0
+ebegin "Testing yesno()"
+for f in yes YES Yes true TRUE True 1 ; do
+ if ! yesno ${f} ; then
+ ((tret+=1))
+ echo "!${f}!"
+ fi
+done
+for f in no NO No false FALSE False 0 ; do
+ if yesno ${f} ; then
+ ((tret+=1))
+ echo "!${f}!"
+ fi
+done
+eend ${tret}
+((ret+=tret))
+
+exit ${ret}