setup a bit of a test framework

This commit is contained in:
Mike Frysinger
2008-03-24 07:17:05 +00:00
parent 1c9c2f9fcf
commit 486d517674
7 changed files with 58 additions and 11 deletions

View File

@@ -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

25
sh/runtests.sh Executable file
View File

@@ -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}