aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-22 21:49:54 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-22 21:49:54 +0000
commit0f62471f2ef6e57cda94967e585972165c121566 (patch)
treeb9ea25b9874cf4285d2e9e689e49e5d217c43b65
parent339be8a3bd2337cc7f1e10dc1aa129ae1d45af68 (diff)
downloadpaludis-0f62471f2ef6e57cda94967e585972165c121566.tar.gz
paludis-0f62471f2ef6e57cda94967e585972165c121566.tar.xz
Add paludis --version output to tests
-rw-r--r--src/Makefile.am6
-rwxr-xr-xsrc/version_TEST.sh4
-rwxr-xr-xtest/run_test.sh30
3 files changed, 24 insertions, 16 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 7e28f45..85c5460 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-CLEANFILES = *~
+CLEANFILES = *~ version_TEST
MAINTAINERCLEANFILES = Makefile.in
AM_CXXFLAGS = -I$(top_srcdir)
DEFS=-DSYSCONFDIR=\"$(sysconfdir)\"
@@ -17,5 +17,9 @@ paludis_LDADD = \
$(top_builddir)/paludis/libpaludis.a \
$(top_builddir)/paludis/args/libpaludisargs.a
+TESTS_ENVIRONMENT = env TEST_SCRIPT_DIR="$(srcdir)/" $(SHELL) $(top_srcdir)/test/run_test.sh bash
+TESTS = version_TEST
+version_TEST :
+ echo -e "#!/bin/sh\n./paludis --version" > $@
diff --git a/src/version_TEST.sh b/src/version_TEST.sh
new file mode 100755
index 0000000..1bc7ad9
--- /dev/null
+++ b/src/version_TEST.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+./paludis --version || exit 1
+
diff --git a/test/run_test.sh b/test/run_test.sh
index 4d0df3d..0663f77 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -1,33 +1,33 @@
#!/bin/sh
# vim: set ft=sh sw=4 sts=4 et :
-if test -f "$TEST_SCRIPT_DIR""$1"_"setup.sh" ; then
- echo ">>> setup for test $1"
- if ! "$TEST_SCRIPT_DIR""$1"_"setup.sh" ; then
- echo ">>> exiting with error for test $1"
+if test -f "$TEST_SCRIPT_DIR""${2:-${1}}"_"setup.sh" ; then
+ echo ">>> setup for test ${2:-${1}}"
+ if ! "$TEST_SCRIPT_DIR""${2:-${1}}"_"setup.sh" ; then
+ echo ">>> exiting with error for test ${2:-${1}}"
exit 255
fi
fi
-echo ">>> test $1"
-if ! $1 ; then
- if test -f "$TEST_SCRIPT_DIR""$1"_"cleanup.sh" ; then
- echo ">>> cleanup for test $1"
- "$TEST_SCRIPT_DIR""$1"_"cleanup.sh"
+echo ">>> test ${2:-${1}}"
+if ! ${@} ; then
+ if test -f "$TEST_SCRIPT_DIR""${2:-${1}}"_"cleanup.sh" ; then
+ echo ">>> cleanup for test ${2:-${1}}"
+ "$TEST_SCRIPT_DIR""${2:-${1}}"_"cleanup.sh"
fi
- echo ">>> exiting with error for test $1"
+ echo ">>> exiting with error for test ${2:-${1}}"
exit 255
fi
-if test -f "$TEST_SCRIPT_DIR""$1"_"cleanup.sh" ; then
- echo ">>> cleanup for test $1"
- if ! "$TEST_SCRIPT_DIR""$1"_"cleanup.sh" ; then
- echo ">>> exiting with error for test $1"
+if test -f "$TEST_SCRIPT_DIR""${2:-${1}}"_"cleanup.sh" ; then
+ echo ">>> cleanup for test ${2:-${1}}"
+ if ! "$TEST_SCRIPT_DIR""${2:-${1}}"_"cleanup.sh" ; then
+ echo ">>> exiting with error for test ${2:-${1}}"
exit 255
fi
fi
-echo ">>> exiting with success for test $1"
+echo ">>> exiting with success for test ${2:-${1}}"
exit 0