From bd7e00096e4ae941164026cb571c70939e13ced2 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Sun, 23 Feb 2014 16:16:12 +0100 Subject: Test installation and phoniness. --- testsuite/library | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'testsuite/library') diff --git a/testsuite/library b/testsuite/library index 4482215..9e4cbbd 100644 --- a/testsuite/library +++ b/testsuite/library @@ -23,8 +23,11 @@ expect_configuration () { expect_generated_files () { # The testcase is expected to generate files which are listed in the file - # generated_files. The list is whitespace-separated and may contain shell - # variable references. + # generated_files, one per line. The lines may contain shell variable + # references. A line that expands into an empty string is ignored. + # A directory name may be passed as a parameter. The generated files will + # then be expected under that directory instead of the default staging + # directory. # These directory variables mustn't be conveyed from Comfignat, because then # the testsuite would rely on the same thing that it's supposed to test. @@ -37,7 +40,7 @@ expect_generated_files () { libdir=${libdir:-${exec_prefix}/lib} alidir=${alidir:-${libdir}} gprdir=${gprdir:-${datarootdir}/gpr} - stagedir=stage + stagedir=${1:-stage} stage_bindir=${stagedir}${bindir} stage_libexecdir=${stagedir}${libexecdir} stage_includedir=${stagedir}${includedir} @@ -45,13 +48,13 @@ expect_generated_files () { stage_alidir=${stagedir}${alidir} stage_gprdir=${stagedir}${gprdir} - for file in $(cat "${srcdir}"/generated_files) ; do + cat "${srcdir}"/generated_files | while read line ; do # Expand variables in the string to get the pathname. - eval file="${file}" + eval file="${line}" # Write the pathname and its parent directories to the file list. # Chop off pathname components until only "." remains, but also avoid # looping forever if the final residue turns out to be "/" or "//". - while [ "${file}" != . -a "${file}" != / -a "${file}" != // ] ; do + while [ -n "${file}" -a "${file}" != . -a "${file}" != / -a "${file}" != // ] ; do echo "${builddir}/${file}" >>"${file_list}" file=$(dirname "${file}") done -- cgit v1.2.3