]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix Autotest for whitespace in `pwd`.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 4 Dec 2007 21:46:18 +0000 (22:46 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 8 Dec 2007 10:49:15 +0000 (11:49 +0100)
* lib/autotest/general.m4 (AT_INIT)
<at_func_create_debugging_script, Driver Loop>:
Quote $at_group_dir.
* tests/autotest.at (whitespace in absolute testdir): New test.

ChangeLog
lib/autotest/general.m4
tests/autotest.at

index 75c1856453f88d60d266804433eb488d7169ed12..425e8c7827421217c78a4b8889163b5eb6f5c156 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-12-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Fix Autotest for whitespace in `pwd`.
+       * lib/autotest/general.m4 (AT_INIT)
+       <at_func_create_debugging_script, Driver Loop>:
+       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.
index 022c56d216fb439e4e0c63b30b436eccc9b6719b..cf33cda5ada33ffadaec221499e0ed30430e11d4 100644 (file)
@@ -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"
 
index fa7b7eae1e40a6c8555908a4ca493319d770be1f..0f3fdf0278c6e61c62d6090b64ed09705ae7b70b 100644 (file)
@@ -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