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.
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
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"
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