mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tests: standardize perl usage in tests
* tests/cp/fiemap-FMR.sh: Ensure perl is parameterized to $PERL, and ensure require_perl_ is used, so tests are skipped appropriately. * tests/cp/preserve-gid.sh: Likewise. * tests/du/long-from-unreadable.sh: Likewise. * tests/misc/env-S-script.sh: Likewise. * tests/misc/sort-benchmark-random.sh: Likewise. * tests/rm/deep-2.sh: Likewise.
This commit is contained in:
1 parent
3246bc08a6
commit
89f7fcd055
6 files changed
+9
-7
No files matched your search
@@ -21,7 +21,6 @@ print_ver_ cp
|
||||
|
||||
require_valgrind_
|
||||
require_perl_
|
||||
: ${PERL=perl}
|
||||
|
||||
$PERL -e 'for (1..600) { sysseek (*STDOUT, 4096, 1)' \
|
||||
-e '&& syswrite (*STDOUT, "a" x 1024) or die "$!"}' > j || fail=1
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
||||
print_ver_ cp
|
||||
|
||||
require_perl_
|
||||
require_root_
|
||||
|
||||
# Some of the tests expect a umask that grants group and/or world read access.
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
||||
print_ver_ du
|
||||
|
||||
require_perl_
|
||||
|
||||
# ecryptfs for example uses some of the file name space
|
||||
# for encrypting filenames, so we must check dynamically.
|
||||
name_max=$(stat -f -c %l .)
|
||||
@@ -58,7 +60,6 @@ dir=$(printf '%200s\n' ' '|tr ' ' x)
|
||||
|
||||
cwd=$(pwd)
|
||||
# Use perl instead:
|
||||
: ${PERL=perl}
|
||||
$PERL \
|
||||
-e 'my $d = '$dir'; foreach my $i (1..52)' \
|
||||
-e ' { mkdir ($d, 0700) && chdir $d or die "$!" }' \
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
||||
print_ver_ env
|
||||
print_ver_ printf
|
||||
|
||||
require_perl_
|
||||
|
||||
# a shortcut to avoid long lines
|
||||
@@ -118,7 +119,7 @@ compare exp4 out4 || fail=1
|
||||
# Ignoring the absolute paths, the script is:
|
||||
# #!env -S perl -w -T
|
||||
# print "hello\n";
|
||||
{ printf "#!$dir/env -S perl -w -T\n" ;
|
||||
{ printf "#!$dir/env -S $PERL -w -T\n" ;
|
||||
printf 'print "hello\\n";\n' ; } > env5 || framework_failure_
|
||||
chmod a+x env5 || framework_failure_
|
||||
cat<<\EOF>exp5 || framework_failure_
|
||||
@@ -134,7 +135,7 @@ compare exp5 out5 || fail=1
|
||||
# The backslash before the '$' is required to prevent env(1) from treating
|
||||
# $ARGV as an (invalid syntax) envvar, and pass it as-is to Perl.
|
||||
{ printf "#!$dir/env -S " ;
|
||||
printf 'perl -mFile::Basename=basename -e ' ;
|
||||
printf "$PERL -mFile::Basename=basename -e " ;
|
||||
printf '"print basename(\\$ARGV[0]);"\n' ; } > env6 || framework_failure_
|
||||
chmod a+x env6 || framework_failure_
|
||||
# Note: the perl script does not output a newline.
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
|
||||
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
||||
print_ver_ sort
|
||||
require_perl_
|
||||
|
||||
very_expensive_
|
||||
|
||||
perl -e '
|
||||
$PERL -e '
|
||||
my $num_lines = 500000;
|
||||
my $length = 100;
|
||||
|
||||
@@ -39,7 +40,7 @@ for (my $i=0; $i < $num_lines; $i++)
|
||||
# We need to generate a lot of data for sort to show a noticeable
|
||||
# improvement in performance. Sorting it in PERL may take awhile.
|
||||
|
||||
perl -e '
|
||||
$PERL -e '
|
||||
open (FILE, "<in");
|
||||
my @list = <FILE>;
|
||||
print sort(@list);
|
||||
|
||||
@@ -34,7 +34,6 @@ mkdir x || framework_failure_
|
||||
cd x || framework_failure_
|
||||
|
||||
# Construct a hierarchy containing a relative file with a long name
|
||||
: ${PERL=perl}
|
||||
$PERL \
|
||||
-e 'my $d = "x" x 200; foreach my $i (1..52)' \
|
||||
-e ' { mkdir ($d, 0700) && chdir $d or die "$!" }' \
|
||||
|
||||
Reference in new issue
Block a user