gdb/testsuite/ 2014-08-29 Jan Kratochvil Fix running in-src-dir in the same directory twice. * gdb.base/argv0-symlink.exp: Move everything into a subdirectory. diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp index d849b4c..2005e7c 100644 --- a/gdb/testsuite/gdb.base/argv0-symlink.exp +++ b/gdb/testsuite/gdb.base/argv0-symlink.exp @@ -15,21 +15,26 @@ standard_testfile -if { [build_executable ${testfile}.exp ${testfile} ${srcfile}] == -1 } { +set outputbase ${testfile}.d +set outputdir [standard_output_file $outputbase] +remote_exec host "rm -rf $outputdir" +file mkdir $outputdir + +if { [build_executable ${testfile}.exp [file join $outputbase ${testfile}] ${srcfile}] == -1 } { return -1 } set test "kept file symbolic link name" set filelink "${testfile}-filelink" -remote_file host delete [standard_output_file $filelink] -set status [remote_exec host "ln -sf ${testfile} [standard_output_file $filelink]"] +remote_file host delete [file join $outputdir $filelink] +set status [remote_exec host "ln -sf ${testfile} [file join $outputdir $filelink]"] if {[lindex $status 0] != 0} { unsupported "$test (host does not support symbolic links)" return 0 } -clean_restart "$filelink" +clean_restart [file join $outputbase $filelink] if ![runto_main] { untested "could not run to main" @@ -44,7 +49,7 @@ gdb_test {print argv[0]} "/$filelink\"" $test # For a link named /PATH/TO/DIR/LINK, we want to check the output # against "/DIR/LINK", but computed in a way that doesn't make # assumptions about the test directory layout. -set full_filelink [standard_output_file $filelink] +set full_filelink [file join $outputdir $filelink] set lastdir [file tail [file dirname $full_filelink]] gdb_test "info inferiors" "/$lastdir/$filelink *" "$test for info inferiors" @@ -56,14 +61,14 @@ set dirlink "${testfile}-dirlink" # 'ln -sf' does not overwrite symbol link to a directory. # 'remote_file host delete' uses stat (not lstat), therefore it refuses to # delete a directory. -remote_exec host "rm -f [standard_output_file $dirlink]" -set status [remote_exec host "ln -sf . [standard_output_file $dirlink]"] +remote_exec host "rm -f [file join $outputdir $dirlink]" +set status [remote_exec host "ln -sf . [file join $outputdir $dirlink]"] if {[lindex $status 0] != 0} { unsupported "$test (host does not support symbolic links)" return 0 } -clean_restart "$dirlink/$filelink" +clean_restart [file join $outputbase $dirlink $filelink] if ![runto_main] { untested "could not run to main"