Rombobjörn

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Persson <Bjorn@Rombobjörn.se>2013-12-17 14:29:11 +0100
committerBjörn Persson <Bjorn@Rombobjörn.se>2013-12-17 14:29:11 +0100
commit098259b44d7895e3bb9537edbbd633fd3e0205d5 (patch)
treef835b9cef7b4c4cc83a177855a1622b74d9821b4
parent940fef353e6551f721651db79cb135219191ad9e (diff)
function library for the testcases
-rw-r--r--testsuite/inputs/clean7
-rw-r--r--testsuite/inputs/default_build7
-rw-r--r--testsuite/inputs/distclean7
-rw-r--r--testsuite/library25
-rwxr-xr-xtestsuite/run_tests9
5 files changed, 38 insertions, 17 deletions
diff --git a/testsuite/inputs/clean b/testsuite/inputs/clean
index ab322cc..6defe0e 100644
--- a/testsuite/inputs/clean
+++ b/testsuite/inputs/clean
@@ -1,7 +1,4 @@
-cd "${srcdir}"
-if [ "${relative_builddir}" != . ] ; then
- make configure builddir="${relative_builddir}"
- cd "${relative_builddir}"
-fi
+. "${library}"
+common_setup
make
make clean
diff --git a/testsuite/inputs/default_build b/testsuite/inputs/default_build
index 7ff31f7..1706516 100644
--- a/testsuite/inputs/default_build
+++ b/testsuite/inputs/default_build
@@ -1,6 +1,3 @@
-cd "${srcdir}"
-if [ "${relative_builddir}" != . ] ; then
- make configure builddir="${relative_builddir}"
- cd "${relative_builddir}"
-fi
+. "${library}"
+common_setup
make
diff --git a/testsuite/inputs/distclean b/testsuite/inputs/distclean
index 6e1119b..76524c3 100644
--- a/testsuite/inputs/distclean
+++ b/testsuite/inputs/distclean
@@ -1,7 +1,4 @@
-cd "${srcdir}"
-if [ "${relative_builddir}" != . ] ; then
- make configure builddir="${relative_builddir}"
- cd "${relative_builddir}"
-fi
+. "${library}"
+common_setup
make
make distclean
diff --git a/testsuite/library b/testsuite/library
new file mode 100644
index 0000000..1302625
--- /dev/null
+++ b/testsuite/library
@@ -0,0 +1,25 @@
+# function library for Comfignat's testcases
+# Copyright 2013 B. Persson, Bjorn@Rombobeorn.se
+#
+# This material is provided as is, with absolutely no warranty expressed
+# or implied. Any use is at your own risk.
+#
+# Permission is hereby granted to use or copy this testsuite
+# for any purpose, provided the above notices are retained on all copies.
+# Permission to modify the code and to distribute modified code is granted,
+# provided the above notices are retained, and a notice that the code was
+# modified is included with the above copyright notice.
+
+
+common_setup () {
+ # When the locations file specifies a separate build directory, initialize
+ # the build directory and go there. When the source directory is also the
+ # build directory, just go to that directory.
+ cd "${srcdir}"
+ if [ "${relative_builddir}" != . ] ; then
+ make configure builddir="${relative_builddir}"
+ cd "${relative_builddir}"
+ fi
+}
+
+
diff --git a/testsuite/run_tests b/testsuite/run_tests
index dfdfe75..c559814 100755
--- a/testsuite/run_tests
+++ b/testsuite/run_tests
@@ -6,7 +6,7 @@
# This material is provided as is, with absolutely no warranty expressed
# or implied. Any use is at your own risk.
#
-# Permission is hereby granted to use or copy this program
+# Permission is hereby granted to use or copy this testsuite
# for any purpose, provided the above notices are retained on all copies.
# Permission to modify the code and to distribute modified code is granted,
# provided the above notices are retained, and a notice that the code was
@@ -27,6 +27,12 @@ Comfignat_overriding_absolute_builddir=
Comfignat_overriding_absolute_objdir=
Comfignat_overriding_absolute_stagedir=
+# variables that the testcases need:
+export library srcdir builddir relative_builddir
+
+# function library for the testcases:
+library="${outer_srcdir}"/testsuite/library
+
rm -Rf "${outer_builddir}"/testruns
for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do
@@ -40,7 +46,6 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do
mkdir -p "${srcdir}" "${builddir}"
cp -RHp "${source_directory}"/* "${srcdir}"
cp -p "${outer_srcdir}"/comfignat.* "${srcdir}"
- export srcdir builddir relative_builddir
if sh -e "${input_script}" >output 2>&1 ; then
verdict=PASSED
passed=$((passed + 1))