Rombobjörn

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Persson <Bjorn@Rombobjörn.se>2013-12-19 09:29:52 +0100
committerBjörn Persson <Bjorn@Rombobjörn.se>2013-12-19 09:29:52 +0100
commitcfde013bbd87fb30ced9c2c9fc4f0d1122c9c569 (patch)
tree8af037fc6a5603161e44c705a7613cc5ca28882b
parent501f9888bff97d68adff2bfde0da7869c04d7e79 (diff)
Made run_test load the function library for the testcases.
-rw-r--r--testsuite/inputs/clean1
-rw-r--r--testsuite/inputs/default_build1
-rw-r--r--testsuite/inputs/distclean1
-rwxr-xr-xtestsuite/run_tests12
4 files changed, 5 insertions, 10 deletions
diff --git a/testsuite/inputs/clean b/testsuite/inputs/clean
index 8f443d5..a0d18f9 100644
--- a/testsuite/inputs/clean
+++ b/testsuite/inputs/clean
@@ -1,4 +1,3 @@
-. "${library}"
common_setup
expect_configuration
make
diff --git a/testsuite/inputs/default_build b/testsuite/inputs/default_build
index cd85823..af01356 100644
--- a/testsuite/inputs/default_build
+++ b/testsuite/inputs/default_build
@@ -1,4 +1,3 @@
-. "${library}"
common_setup
expect_configuration
make
diff --git a/testsuite/inputs/distclean b/testsuite/inputs/distclean
index 76524c3..6e5e472 100644
--- a/testsuite/inputs/distclean
+++ b/testsuite/inputs/distclean
@@ -1,4 +1,3 @@
-. "${library}"
common_setup
make
make distclean
diff --git a/testsuite/run_tests b/testsuite/run_tests
index 57364b3..38d6562 100755
--- a/testsuite/run_tests
+++ b/testsuite/run_tests
@@ -32,15 +32,11 @@ Comfignat_overriding_absolute_objdir=
Comfignat_overriding_absolute_stagedir=
# variables that the testcases need:
-export library # absolute pathname of function library
export file_list # absolute pathname of list of expected files
export srcdir # testcase's source directory relative to testrundir
export builddir # testcase's build directory relative to testrundir
export relative_builddir # testcase's build directory relative to srcdir
-# function library for the testcases:
-library="${outer_srcdir}"/testsuite/library
-
# Clean out any old test results.
rm -Rf "${outer_builddir}"/testruns
@@ -48,7 +44,7 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do
for location_file in "${outer_srcdir}"/testsuite/locations/* ; do
for input_script in "${outer_srcdir}"/testsuite/inputs/* ; do
- # Compose the name of the combined test case.
+ # Compose the name of the combined testcase.
test_name=$(basename "${source_directory}")+$(basename "${location_file}")+$(basename "${input_script}")
testrundir="${outer_builddir}"/testruns/"${test_name}"
file_list="${testrundir}"/files.expected
@@ -67,8 +63,10 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do
cp -p "${outer_srcdir}"/comfignat.* "${srcdir}"
find "${srcdir}" >>files.expected
- # Run the test.
- if sh -e "${input_script}" >output 2>&1 ; then
+ # Run the testcase in a child process.
+ # The child process first loads the function library and then runs the
+ # input script.
+ if sh -e -c ". ${outer_srcdir}/testsuite/library; . ${input_script}" >output 2>&1 ; then
# Check that the expected files and no others are present.
LC_COLLATE=C sort -o files.expected files.expected