From: Jim Meyering Date: Tue, 27 May 2008 11:24:20 +0000 (+0200) Subject: prefer abs_srcdir over abs_top_srcdir, ... X-Git-Tag: v6.12~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6c9e8730e23af5d96a3b25331b0510112422abb;p=thirdparty%2Fcoreutils.git prefer abs_srcdir over abs_top_srcdir, ... so that e.g., tests/* may refer to absolute names without hard-coding the name of the containing directory (tests/, here). * tests/check.mk (TESTS_ENVIRONMENT): Define abs_srcdir. * tests/pr/pr-tests: Use $abs_srcdir/pr not $abs_top_srcdir/tests/pr. * tests/chmod/c-option: Use $abs_srcdir, not $abs_top_srcdir/tests. * tests/cp/cp-parents: Likewise. * tests/mkdir/parents: Likewise. * tests/mkdir/perm: Likewise. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/into-self-2: Likewise. * tests/mv/leak-fd: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/part-hardlink: Likewise. * tests/mv/part-rename: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/partition-perm: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/mv/to-symlink: Likewise. * tests/rm/one-file-system: Likewise. * tests/sample-test: Likewise. --- diff --git a/tests/check.mk b/tests/check.mk index feb4fc0400..5cb8b781ea 100644 --- a/tests/check.mk +++ b/tests/check.mk @@ -70,6 +70,7 @@ TESTS_ENVIRONMENT = \ LOCALE_FR='$(LOCALE_FR)' \ abs_top_builddir='$(abs_top_builddir)' \ abs_top_srcdir='$(abs_top_srcdir)' \ + abs_srcdir='$(abs_srcdir)' \ built_programs="`$(built_programs)`" \ host_os=$(host_os) \ host_triplet='$(host_triplet)' \ diff --git a/tests/chmod/c-option b/tests/chmod/c-option index e756b5be8f..461b6faa25 100755 --- a/tests/chmod/c-option +++ b/tests/chmod/c-option @@ -28,7 +28,7 @@ file=f touch $file || framework_failure chmod 444 $file || framework_failure -. "$abs_top_srcdir/tests/setgid-check" +. "$abs_srcdir/setgid-check" fail=0 diff --git a/tests/cp/cp-parents b/tests/cp/cp-parents index 5b3913a7fd..3394265bb9 100755 --- a/tests/cp/cp-parents +++ b/tests/cp/cp-parents @@ -28,7 +28,7 @@ fi working_umask_or_skip_ # Run the setgid check from the just-created directory. -. "$abs_top_srcdir/tests/setgid-check" +. "$abs_srcdir/setgid-check" mkdir foo bar || framework_failure mkdir -p a/b/c d e g || framework_failure diff --git a/tests/mkdir/parents b/tests/mkdir/parents index 72fb05a4bb..2aee87e6f7 100755 --- a/tests/mkdir/parents +++ b/tests/mkdir/parents @@ -22,7 +22,7 @@ if test "$VERBOSE" = yes; then fi . $top_srcdir/tests/test-lib.sh -. "$abs_top_srcdir/tests/setgid-check" +. "$abs_srcdir/setgid-check" mkdir -m 700 e-dir || framework_failure diff --git a/tests/mkdir/perm b/tests/mkdir/perm index 5e010139d3..6df1d4339c 100755 --- a/tests/mkdir/perm +++ b/tests/mkdir/perm @@ -23,7 +23,7 @@ if test "$VERBOSE" = yes; then fi . $top_srcdir/tests/test-lib.sh -. "$abs_top_srcdir/tests/setgid-check" +. "$abs_srcdir/setgid-check" working_umask_or_skip_ diff --git a/tests/mv/acl b/tests/mv/acl index 858c2aff92..536391a68e 100755 --- a/tests/mv/acl +++ b/tests/mv/acl @@ -32,7 +32,7 @@ grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null && skip_test_ "insufficient ACL support" cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" touch file || framework_failure t1=$other_partition_tmpdir/t1 diff --git a/tests/mv/backup-is-src b/tests/mv/backup-is-src index 3335d07586..3c41ecba87 100755 --- a/tests/mv/backup-is-src +++ b/tests/mv/backup-is-src @@ -23,7 +23,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" a="$other_partition_tmpdir/a" a2="$other_partition_tmpdir/a~" diff --git a/tests/mv/hard-link-1 b/tests/mv/hard-link-1 index 6afaeade6b..fd586aeca0 100755 --- a/tests/mv/hard-link-1 +++ b/tests/mv/hard-link-1 @@ -24,7 +24,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" dir=hlink diff --git a/tests/mv/into-self-2 b/tests/mv/into-self-2 index 32801a3a4a..ffc97c3162 100755 --- a/tests/mv/into-self-2 +++ b/tests/mv/into-self-2 @@ -25,7 +25,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" file="$other_partition_tmpdir/file" symlink=symlink diff --git a/tests/mv/leak-fd b/tests/mv/leak-fd index 1ecdb20c47..127a826ab8 100755 --- a/tests/mv/leak-fd +++ b/tests/mv/leak-fd @@ -26,7 +26,7 @@ fi . $top_srcdir/tests/test-lib.sh skip_if_root_ cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" # This test is relatively expensive, and might well evoke a # framework-failure on systems with a smaller command-line length diff --git a/tests/mv/mv-special-1 b/tests/mv/mv-special-1 index d883f5b123..ff4869fc2a 100755 --- a/tests/mv/mv-special-1 +++ b/tests/mv/mv-special-1 @@ -24,7 +24,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" null=mv-null dir=mv-dir diff --git a/tests/mv/part-fail b/tests/mv/part-fail index e5396c2c6d..fdbab1d7d7 100755 --- a/tests/mv/part-fail +++ b/tests/mv/part-fail @@ -27,7 +27,7 @@ fi . $top_srcdir/tests/test-lib.sh skip_if_root_ cleanup_() { t=$other_partition_tmpdir; chmod -R 700 "$t"; rm -rf "$t"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" touch k $other_partition_tmpdir/k || framework_failure chmod u-w $other_partition_tmpdir || framework_failure diff --git a/tests/mv/part-hardlink b/tests/mv/part-hardlink index fed5bcf347..8f83fcf27b 100755 --- a/tests/mv/part-hardlink +++ b/tests/mv/part-hardlink @@ -26,7 +26,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" touch f || framework_failure ln f g || framework_failure diff --git a/tests/mv/part-rename b/tests/mv/part-rename index 30913ec101..009c6d4435 100755 --- a/tests/mv/part-rename +++ b/tests/mv/part-rename @@ -25,7 +25,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" mkdir foo || framework_failure diff --git a/tests/mv/part-symlink b/tests/mv/part-symlink index 0b7e21347d..68c46f9ea6 100755 --- a/tests/mv/part-symlink +++ b/tests/mv/part-symlink @@ -25,7 +25,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" pwd_tmp=`pwd` diff --git a/tests/mv/partition-perm b/tests/mv/partition-perm index ca32e473f7..a8ca44c8e5 100755 --- a/tests/mv/partition-perm +++ b/tests/mv/partition-perm @@ -23,7 +23,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" : > file chmod a=rwx file diff --git a/tests/mv/sticky-to-xpart b/tests/mv/sticky-to-xpart index d0e90c1acb..38f3836927 100755 --- a/tests/mv/sticky-to-xpart +++ b/tests/mv/sticky-to-xpart @@ -28,7 +28,7 @@ fi require_root_ cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" # Set up to run a test where non-root user tries to move a root-owned # file from a sticky tmpdir to a directory owned by that user on diff --git a/tests/mv/to-symlink b/tests/mv/to-symlink index b265a3e313..12f1447d1d 100755 --- a/tests/mv/to-symlink +++ b/tests/mv/to-symlink @@ -24,7 +24,7 @@ fi . $top_srcdir/tests/test-lib.sh cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" rem_file="$other_partition_tmpdir/file" rem_symlink="$other_partition_tmpdir/symlink" diff --git a/tests/pr/pr-tests b/tests/pr/pr-tests index b5fe2e09ea..f5a32a8f4b 100755 --- a/tests/pr/pr-tests +++ b/tests/pr/pr-tests @@ -394,7 +394,7 @@ my @tv = ( # Convert the above old-style test vectors to the newer # format used by Coreutils.pm. -my $pfx = "$ENV{abs_top_srcdir}/tests/pr"; +my $pfx = "$ENV{abs_srcdir}/pr"; # Normalize otherwise-variable output page headers. my $common_option_prefix = '--date-format="-- Date/Time --" -h x'; diff --git a/tests/rm/one-file-system b/tests/rm/one-file-system index eb8482de8e..0030f34379 100755 --- a/tests/rm/one-file-system +++ b/tests/rm/one-file-system @@ -26,7 +26,7 @@ require_root_ # If used, these must *follow* test-lib.sh. cleanup_() { rm -rf "$other_partition_tmpdir"; } -. "$abs_top_srcdir/tests/other-fs-tmpdir" +. "$abs_srcdir/other-fs-tmpdir" t=$other_partition_tmpdir mkdir -p a/b $t/y diff --git a/tests/sample-test b/tests/sample-test index e6ef5b6fac..a9ec3a48ca 100644 --- a/tests/sample-test +++ b/tests/sample-test @@ -28,7 +28,7 @@ fi # If used, these must *follow* test-lib.sh. # FIXME: cleanup_() { rm -rf "$other_partition_tmpdir"; } -# FIXME: . "$abs_top_srcdir/tests/other-fs-tmpdir" +# FIXME: . "$abs_srcdir/other-fs-tmpdir" fail=0 FIXME > out || fail=1