2010-09-06 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Tests defs: new variable $top_testsrcdir.
+ * tests/defs.in ($top_testsrcdir): Define unconditionally
+ to @abs_top_srcdir@. Use it throughout.
+ * tests/ar-lib.test: Use `$top_testsrcdir' instead of
+ `$testsrcdir/..'.
+ * tests/auxdir.test: Likewise.
+ * tests/compile.test: Likewise.
+ * tests/compile2.test: Likewise.
+ * tests/compile3.test: Likewise.
+ * tests/compile5.test: Likewise.
+ * tests/mdate6.test: Likewise.
+ * tests/mkinst3.test: Likewise.
+ * tests/multlib.test: Likewise.
+ * tests/txinfo22.test: Likewise.
+
Tests defs: $srcdir is unconditionally substituted.
* tests/defs.in ($srcdir): Define unconditionally to @abs_srcdir@.
Remove code for $srcdir normalization, which is now useless.
set -e
-cp "$testsrcdir/../lib/ar-lib" .
+cp "$top_testsrcdir/lib/ar-lib" .
+
# Use a dummy lib, since lib isn't readily available on all systems
cat >lib <<'END'
#! /bin/sh
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003, 2004, 2007, 2010 Free Software
+# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
pkgdata_DATA =
END
-cp "$testsrcdir/../lib/mkinstalldirs" .
+cp "$top_testsrcdir/lib/mkinstalldirs" .
# The "././" prefix confuses Automake into thinking it is doing a
# subdir build. Yes, this is hacky.
#! /bin/sh
-# Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
set -e
-cp "$testsrcdir/../lib/compile" .
+cp "$top_testsrcdir/lib/compile" .
# -o 'a c' should not be stripped because 'a c' is not an object
# (it does not matter whether touch creates ./-- or not)
#! /bin/sh
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
set -e
-cp "$testsrcdir/../lib/compile" .
+cp "$top_testsrcdir/lib/compile" .
cat >mycc <<'END'
source_seen=no
set -e
-cp "$testsrcdir/../lib/compile" .
+cp "$top_testsrcdir/lib/compile" .
# Use a dummy cl, since cl isn't readily available on all systems
cat >cl <<'END'
set -e
-cp "$testsrcdir/../lib/compile" .
+cp "$top_testsrcdir/lib/compile" .
# Use a dummy cl, since cl isn't readily available on all systems
cat >cl <<'END'
# Absolutely necessary variable(s).
srcdir='@abs_srcdir@'
+top_testsrcdir='@abs_top_srcdir@'
# Protect this file against multiple inclusion, useful for generated tests.
if test x"$am_skip_defs" = xyes; then
test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
-test -z "$MISSING" && MISSING=`pwd`/../lib/missing
+test -z "$MISSING" && MISSING=$top_testsrcdir/lib/missing
# Use -Werror because this also turns some Perl warnings into error.
# (Tests for which this is inappropriate should use -Wno-error.)
test -z "$ACLOCAL" && ACLOCAL="aclocal-@APIVERSION@ -Werror"
# Copy in some files we need.
for file in install-sh missing depcomp; do
- cp "$srcdir/../lib/$file" "$testSubDir/$file" || Exit 1
+ cp "$top_testsrcdir/lib/$file" "$testSubDir/$file" || Exit 1
done
cd ./$testSubDir
# We might need extra macros, e.g., from Libtool or Gettext.
# Find them on the system.
-# Use `-I $srcdir/../m4' in addition to `--acdir=$srcdir/../m4', because the
-# other `-I' directories added for libtool and gettext might contain
-# files from an old version of Automake that we don't want to use.
+# Use `-I $top_testsrcdir/m4' in addition to `--acdir=$top_testsrcdir/m4',
+# because the other `-I' directories added for libtool and gettext might
+# contain files from an old version of Automake that we don't want to use.
# Use `-Wno-syntax' because we do not want our test suite to fail because
# some third-party .m4 file is underquoted.
case " $required " in
case $srcdir,`pwd` in
*\ * | *\ *) Exit 77;;
esac
- ACLOCAL="$ACLOCAL -Wno-syntax -I $srcdir/../m4 $extra_includes -I $aclocaldir"
+ ACLOCAL="$ACLOCAL -Wno-syntax -I $top_testsrcdir/m4 $extra_includes -I $aclocaldir"
;;
esac
-testaclocaldir='@abs_top_srcdir@/m4'
+testaclocaldir=$top_testsrcdir/m4
# POSIX no longer requires 'egrep' and 'fgrep',
# but some hosts lack 'grep -E' and 'grep -F'.
file='file name $a'
( : > "$file" ) || Exit 77
-cp "$testsrcdir"/../lib/mdate-sh .
+cp "$top_testsrcdir/lib/mdate-sh" .
$SHELL ./mdate-sh "$file" >stdout 2>stderr ||
{ cat stdout; cat stderr >&2; Exit 1; }
cat stdout
#! /bin/sh
-# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
mkdir '~a b/-x y' || Exit 77
rm -rf '~a b'
-cp "$testsrcdir/../lib/mkinstalldirs" .
+cp "$top_testsrcdir/lib/mkinstalldirs" .
# Test mkinstalldirs with the installed mkdir.
: > libbar/bar.c
-cp "$testsrcdir/../lib/config-ml.in" .
-cp "$testsrcdir/../lib/symlink-tree" .
+cp "$top_testsrcdir/lib/config-ml.in" .
+cp "$top_testsrcdir/lib/symlink-tree" .
$ACLOCAL
$AUTOCONF
END
$PERL -ne '/AU_DEFUN\(\[(\w+)\]/ && print "$1\n"' \
- "$testsrcdir/../m4/obsolete.m4" >> obs
+ "$top_testsrcdir/m4/obsolete.m4" >> obs
cat obs >> configure.in
$PERL -ne 'chomp; print "grep $_ stderr || Exit 1\n"; ' obs > obs.1
$PERL -ne 'chomp; print "grep $_ configure.in && Exit 1\n"; ' obs > obs.2
#! /bin/sh
-# Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2007, 2008, 2010 Free Software Foundation,
+# Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
mkdir aux1
mkdir tex
-cp "$testsrcdir/../lib/texinfo.tex" tex
+cp "$top_testsrcdir/lib/texinfo.tex" tex
$ACLOCAL
$AUTOMAKE --add-missing