summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-07-03 13:09:10 +0000
committerRoy Marples <roy@marples.name>2008-07-03 13:09:10 +0000
commit28a65393ca08cb1a27672305fe6e6210ee2f0a9e (patch)
treef0f049af68d849c786a17d4a63d4cbda2dce8c5e /src/test
parentaa57dd1ff61c41457cf4e87c71b4822cbb789c42 (diff)
downloadopenrc-28a65393ca08cb1a27672305fe6e6210ee2f0a9e.tar.gz
openrc-28a65393ca08cb1a27672305fe6e6210ee2f0a9e.tar.bz2
openrc-28a65393ca08cb1a27672305fe6e6210ee2f0a9e.tar.xz
More unit fixes.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/.gitignore1
-rw-r--r--src/test/Makefile5
-rwxr-xr-xsrc/test/runtests.sh5
-rwxr-xr-xsrc/test/units/is_older_than5
4 files changed, 11 insertions, 5 deletions
diff --git a/src/test/.gitignore b/src/test/.gitignore
index e87afd9..ce2b1b1 100644
--- a/src/test/.gitignore
+++ b/src/test/.gitignore
@@ -1 +1,2 @@
/*.out
+tmp-*
diff --git a/src/test/Makefile b/src/test/Makefile
index a283e73..bdc0587 100644
--- a/src/test/Makefile
+++ b/src/test/Makefile
@@ -7,5 +7,8 @@ gitignore:
check test::
./runtests.sh
+verbose-test:
+ VERBOSE=yes ./runtests.sh
+
clean:
- rm -f *.out
+ rm -rf *.out tmp-*
diff --git a/src/test/runtests.sh b/src/test/runtests.sh
index 40fe151..076bd75 100755
--- a/src/test/runtests.sh
+++ b/src/test/runtests.sh
@@ -68,10 +68,9 @@ ret=$(($ret + $?))
einfo "Running unit tests"
eindent
-cd units
-for u in *; do
+for u in units/*; do
[ -x "${u}" -a -f "${u}" ] || continue
- ebegin "${u}"
+ ebegin "$(basename "${u}")"
./"${u}"
eend $?
ret=$(($ret + $?))
diff --git a/src/test/units/is_older_than b/src/test/units/is_older_than
index 494abbc..e3df780 100755
--- a/src/test/units/is_older_than
+++ b/src/test/units/is_older_than
@@ -2,9 +2,12 @@
# unit test for is_older_than code of baselayout (2008/06/19)
# Author: Matthias Schwarzott <zzam@gentoo.org>
-RCDIR=../../rc
TMPDIR=tmp-"$(basename "$0")"
+# Please note that we added this unit test because the function
+# should really be called is_newer_than as it's what it's really testing.
+# Or more perversly, returning 0 on failure and 1 and success.
+
# bool is_older_than(reference, files/dirs to check)
#
# return 0 if any of the files/dirs are newer than