[testsuite] Robustify lib/g++.exp
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Test passed
|
Commit Message
I often find it useful to run "make -k check" on a cross-compiler even
without a supporting toolchain to perform compile-only testing.
This works for the gcc and gfortran testsuites, but I'm currently
seeing no results reported for g++ due to:
Running /home/roger/GCC/combined/gcc/testsuite/g++.dg/analyzer/analyzer.exp
...
sh:
/home/roger/GCC/buildas2/arc-linux/./libstdc++-v3/scripts/testsuite_flags: N
o such file or directory
while executing
"exec sh ${odir}/scripts/testsuite_flags --build-includes"
(procedure "g++_include_flags" line 16)
invoked from within
"g++_include_flags [get_multilibs] "
...
This patch adds a defensive test to lib/g++.exp to check for the
existence of a (script) file before attempting to execute it.
The real issue may be figuring out why scripts/testsuite_flags isn't
being created, but there's no harm in (also) confirming that it
exists in g++_include_flags.
This patch has been tested on x86_64-pc-linux-gnu (where it allows
a cross-compiler to arc-linux to produce g++ compilation results).
Ok for mainline?
2024-07-22 Roger Sayle <roger@nextmovesoftware.com>
gcc/testsuite/ChangeLog
* lib/g++.exp (g++_include_flags): Check that the testsuite_flags
script exists before executing it.
Thanks in advance,
Roger
--
@@ -93,7 +93,9 @@ proc g++_include_flags { paths } {
set odir [lookfor_file ${gccpath} libstdc++-v3]
if { ${odir} != "" } {
- append flags [exec sh ${odir}/scripts/testsuite_flags --build-includes]
+ if [file exists "${odir}/scripts/testsuite_flags"] {
+ append flags [exec sh ${odir}/scripts/testsuite_flags --build-includes]
+ }
}
return "$flags"