5 $PERL -e 1 > /dev/null 2>&1 || {
6 echo 1>&2 "$0: configure didn't find a usable version of Perl," \
7 "so can't run this test"
12 pwd=`${BUILD_SRC_DIR?}/pwd` || framework_failure=1
13 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
14 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
15 trap '(exit $?); exit $?' 1 2 13 15
17 mkdir -p $tmp || framework_failure=1
18 cd $tmp || framework_failure=1
20 if test $framework_failure = 1; then
21 echo "$0: failure in testing framework" 1>&2
33 # Show that pwd works even when the length of the resulting
34 # directory name is longer than PATH_MAX.
38 (my $ME = $ENV{ARGV_0}) =~ s|.*/||;
43 my $expected = $cwd . ("/$z" x $n);
49 or die "$ME: at depth $i: $!\n";
54 my $build_src_dir = $ENV{BUILD_SRC_DIR};
56 or die "$ME: envvar BUILD_SRC_DIR not defined\n";
57 my $pwd_binary = "$build_src_dir/pwd";
59 or die "$ME: $pwd_binary is not an executable file\n";
60 chomp (my $actual = `$pwd_binary`);
61 if ($expected ne $actual)
63 my $e_len = length $expected;
64 my $a_len = length $actual;
65 warn "expected len: $e_len\n";
66 warn "actual len: $a_len\n";
67 warn "expected: $expected\n";
68 warn "actual: $actual\n";