From 064ce0b6be217db3af41216880259003322a6c81 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Tue, 4 Dec 2007 22:46:18 +0100 Subject: [PATCH] Fix Autotest for whitespace in `pwd`. * lib/autotest/general.m4 (AT_INIT) : Quote $at_group_dir. * tests/autotest.at (whitespace in absolute testdir): New test. --- ChangeLog | 6 ++++++ lib/autotest/general.m4 | 8 ++++---- tests/autotest.at | 31 +++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75c18564..425e8c78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-12-08 Ralf Wildenhues + Fix Autotest for whitespace in `pwd`. + * lib/autotest/general.m4 (AT_INIT) + : + Quote $at_group_dir. + * tests/autotest.at (whitespace in absolute testdir): New test. + * lib/autom4te.in: Quote @datadir@. Proper file name escaping in Autoconf programs and Perl modules. diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 022c56d2..cf33cda5 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -334,8 +334,8 @@ at_func_create_debugging_script () AS_ECHO(["exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d ]dnl [$at_debug_args $at_group \${1+\"\$[@]\"}"]) echo 'exit 1' - } >$at_group_dir/run - chmod +x $at_group_dir/run + } >"$at_group_dir/run" + chmod +x "$at_group_dir/run" } # at_func_arith @@ -911,8 +911,8 @@ do AS_WARN([test directory could not be cleaned.]) fi # Be tolerant if the above `rm' was not able to remove the directory. - AS_MKDIR_P([$at_group_dir]) - cd $at_group_dir + AS_MKDIR_P(["$at_group_dir"]) + cd "$at_group_dir" echo 0 > "$at_status_file" diff --git a/tests/autotest.at b/tests/autotest.at index fa7b7eae..0f3fdf02 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -618,3 +618,34 @@ AT_CHECK([./suite], [0], [ignore]) cd ../.. AT_CLEANUP + + +## ------------------------------ ## +## whitespace in absolute testdir ## +## ------------------------------ ## + +AT_SETUP([whitespace in absolute testdir]) +AT_KEYWORDS([autotest]) + +dir='dir with whitespace' +mkdir "$dir" +cd "$dir" +wd=`pwd` + +AT_DATA([a]) +AT_DATA([suite.at], +[[m4_define([AT_PACKAGE_NAME], [GNU Nonsense]) +m4_define([AT_PACKAGE_TARNAME], [nonsense]) +m4_define([AT_PACKAGE_VERSION], [1.0]) +m4_define([AT_PACKAGE_STRING], [GNU Nonsense 1.0]) +m4_define([AT_PACKAGE_BUGREPORT], [bug-autoconf@gnu.org]) +AT_INIT([suite to check srcdir]) +AT_SETUP([my only test]) +AT_CHECK([test -f "$top_srcdir"/a]) +AT_CLEANUP +]]) +AT_CHECK_AUTOM4TE([--language=autotest -o suite suite.at]) +AT_CHECK([top_srcdir=$wd ./suite], [0], [ignore]) +AT_CHECK([top_srcdir=$wd ./suite -d], [0], [ignore]) +AT_CHECK([cd suite.dir/1 && ./run top_srcdir="$wd"], [0], [ignore]) +AT_CLEANUP -- 2.47.2