From b68613434a67f8a92fc4cc95aaa07a80fa93e1c3 Mon Sep 17 00:00:00 2001 From: jay Date: Mon, 22 Jan 2007 10:56:47 +0000 Subject: [PATCH] Added new test for Savannah bug# 18466 --- ChangeLog | 9 ++++++++ find/testsuite/config/unix.exp | 37 ++++++++++++++++++++++++++------- find/testsuite/find.gnu/execdir-pwd.exp | 37 ++++++++++++++++++++++++--------- 3 files changed, 65 insertions(+), 18 deletions(-) rewrite find/testsuite/find.gnu/execdir-pwd.exp (66%) diff --git a/ChangeLog b/ChangeLog index 551df90..709e090 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2007-01-22 James Youngman + * find/testsuite/config/unix.exp (find_start): allow a test to be + skipped for either the old or the new find executable. + * find/testsuite/find.gnu/execdir-pwd.exp: New test, covering + Savannah bug #18466. This test currently fails for the ftsfind + binary and passes for the oldfind binary. Due to a limitation in + the way that we perform the test, we can't expect a failure in the + new binary but not the old. Therefore we skip the test for the + old binary. + * lib/regeprops.c (describe_regex_syntax): fixed a typo in the text * doc/find.texi (Multiple Files): fixed a typo diff --git a/find/testsuite/config/unix.exp b/find/testsuite/config/unix.exp index bc07667..7e66521 100644 --- a/find/testsuite/config/unix.exp +++ b/find/testsuite/config/unix.exp @@ -98,14 +98,29 @@ proc do_find_start { suffix findprogram flags passfail options infile output } { set scriptname [uplevel {info script}] set testbase [file rootname $scriptname] - set fail_good [string match "f*" $passfail] - if { ! $fail_good } { - if { ! [string match "p*" $passfail] } { - untested "Badly defined test" - error "The first argument to find_start was $passfail but it should begin with either p (pass) or f (fail)" + + if { [string match "f*" $passfail] } { + set fail_good 1 + } else { + if { [string match "p*" $passfail] } { + set fail_good 0 + } else { + if { [string match "xf*" $passfail] } { + setup_xfail "*-*-*" + set fail_good 1 + } else { + if { [string match "xp*" $passfail] } { + setup_xfail "*-*-*" + set fail_good 0 + } else { + # badly formed + untested "Badly defined test" + error "The first argument to find_start was $passfail but it should begin with p (pass) or f (fail) or xf (should fail but we know it passes) or xp (should pass but we know it fails)" + } + } } } - + set test [file tail $testbase] set testname "$test.$suffix" @@ -178,6 +193,8 @@ proc find_start { passfail options {infile ""} {output ""}} { global FTSFIND global FINDFLAGS global comp_output + global SKIP_OLD + global SKIP_NEW if {$infile != ""} then { set msg "Did not expect infile parameter to be set" @@ -197,8 +214,12 @@ proc find_start { passfail options {infile ""} {output ""}} { # Now run the test with each binary, once with each optimisation level. foreach optlevel {0 1 2 3} { set flags "$FINDFLAGS -O$optlevel" - do_find_start old-O$optlevel $OLDFIND $flags $passfail $options $infile $output - do_find_start new-O$optlevel $FTSFIND $flags $passfail $options $infile $output + if { ![info exists SKIP_OLD] || ! $SKIP_OLD } { + do_find_start old-O$optlevel $OLDFIND $flags $passfail $options $infile $output + } + if { ![info exists SKIP_NEW] || !$SKIP_NEW } { + do_find_start new-O$optlevel $FTSFIND $flags $passfail $options $infile $output + } } } diff --git a/find/testsuite/find.gnu/execdir-pwd.exp b/find/testsuite/find.gnu/execdir-pwd.exp dissimilarity index 66% index 2e6d4e3..04ca24a 100644 --- a/find/testsuite/find.gnu/execdir-pwd.exp +++ b/find/testsuite/find.gnu/execdir-pwd.exp @@ -1,10 +1,27 @@ -# tests for -execdir pwd \+ -if { [ safe_path ] } { - exec rm -rf tmp - exec mkdir tmp - exec touch tmp/foo - set expected [ exec sh -c "cd tmp && /bin/pwd" ] - verbose "Expected output for the pwd invoked by find is is $expected" 2 - find_start p {tmp -name foo -execdir /bin/pwd \; } "" $expected - exec rm -rf tmp -} +# tests for -execdir pwd \+ +if { [ safe_path ] } { + global SKIP_OLD + + # For the moment we expect this test to fail for ftsfind.. + send_log "This test is expected to fail for ftsfind but not oldfind\n" + send_log "The PRMS number refers to http://savannah.gnu.org/bugs/?18466\n" + setup_xfail "*-*-*" "18466" + + exec rm -rf tmp + exec mkdir tmp + + # Create an empty shell script. + exec touch tmp/foo + exec chmod +x tmp/foo + + # The -execdir should find the "foo" in the current directory. + # If not, the find command is probably executing the command + # built up by -execdir in the wrong directory. + + set SKIP_OLD 1 + find_start xp {tmp -name foo -execdir sh ./foo \{\} + } "" + set SKIP_OLD 0 + exec rm -rf tmp + + clear_xfail +} -- 2.11.4.GIT