diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-11-21 03:06:20 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-11-26 19:27:21 -0500 |
commit | e1e1ae6e9b5e76daed22c8b2eb79fa3b5ade3335 (patch) | |
tree | 205dafa026bd39afbe1d4d2897ce1300edd3ad83 /sim/testsuite/lib | |
parent | 03c0f9c2057d361a1d9e717624ab94e4b7d67bf2 (diff) | |
download | binutils-e1e1ae6e9b5e76daed22c8b2eb79fa3b5ade3335.zip binutils-e1e1ae6e9b5e76daed22c8b2eb79fa3b5ade3335.tar.gz binutils-e1e1ae6e9b5e76daed22c8b2eb79fa3b5ade3335.tar.bz2 |
sim: testsuite: fix objdir handling
The tests assume that the cwd is the objdir directory and write its
intermediates to there all the time. When using runtest's --objdir
setting though, this puts the files in the wrong place. This isn't
a big problem currently as we never change --objdir, but in order to
support parallel test execution, we're going to start setting that
option, so clean up the code ahead of time.
We also have to tweak some of the cris tests which were making
assumptions about the argv[0] value.
Diffstat (limited to 'sim/testsuite/lib')
-rw-r--r-- | sim/testsuite/lib/sim-defs.exp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp index d10246e..405f1b7 100644 --- a/sim/testsuite/lib/sim-defs.exp +++ b/sim/testsuite/lib/sim-defs.exp @@ -40,13 +40,13 @@ proc sim_tool_path {} { global sim_path set sim "$sim_path" if [string equal "" $sim] { - global objdir + global builddir global subdir set arch "$subdir" while { [file dirname $arch] != "." } { set arch [file dirname $arch] } - return "$objdir/$arch/run" + return "$builddir/$arch/run" } return "$sim" } @@ -181,7 +181,7 @@ proc sim_run { prog sim_opts prog_opts redir options } { # optional for xfail. proc run_sim_test { name requested_machs } { - global subdir srcdir + global subdir srcdir objdir global opts global cpu_option global cpu_option_sep @@ -328,16 +328,16 @@ proc run_sim_test { name requested_machs } { } if [string match "*.c" $sourcefile] { - set comp_output [target_compile $sourcefile ${name}.x "executable" \ + set comp_output [target_compile $sourcefile $objdir/${name}.x "executable" \ [list "incdir=$srcdir/$subdir" "additional_flags=$c_as_options $c_ld_options $opts(cc,$mach)"]] set method "compiling/linking" } else { if [string match "*.S" $sourcefile] { - set comp_output [target_compile $sourcefile ${name}.o "object" \ + set comp_output [target_compile $sourcefile $objdir/${name}.o "object" \ [list "incdir=$srcdir/$subdir" "additional_flags=$c_as_options"]] set method "compiling" } else { - set comp_output [target_assemble $sourcefile ${name}.o "$as_options"] + set comp_output [target_assemble $sourcefile $objdir/${name}.o "$as_options"] set method "assembling" } @@ -347,7 +347,7 @@ proc run_sim_test { name requested_machs } { continue } - set comp_output [target_link ${name}.o ${name}.x "$opts(ld,$mach)"] + set comp_output [target_link $objdir/${name}.o $objdir/${name}.x "$opts(ld,$mach)"] set method "linking" } @@ -368,7 +368,7 @@ proc run_sim_test { name requested_machs } { set options "$options timeout=$opts(timeout)" } - set result [sim_run ${name}.x "$opts(sim,$mach) $SIMFLAGS_FOR_TARGET" "$opts(progopts)" "" "$options"] + set result [sim_run $objdir/${name}.x "$opts(sim,$mach) $SIMFLAGS_FOR_TARGET" "$opts(progopts)" "" "$options"] set return_code [lindex $result 0] set output [lindex $result 1] @@ -383,7 +383,7 @@ proc run_sim_test { name requested_machs } { if { "$opts(xerror)" == "no" } { if [string match $opts(output) $output] { pass "$mach $testname" - file delete ${name}.o ${name}.x + file delete $objdir/${name}.o $objdir/${name}.x } else { verbose -log "status: $return_code" 3 verbose -log "output: $output" 3 @@ -400,7 +400,7 @@ proc run_sim_test { name requested_machs } { } else { if [string match $opts(output) $output] { pass "$mach $testname" - file delete ${name}.o ${name}.x + file delete $objdir/${name}.o $objdir/${name}.x } else { verbose -log "status: $return_code" 3 verbose -log "output: $output" 3 |