ld/testsuite: skip bootstrap.exp when OFILES are missing
authorClément Chigot <chigot@adacore.com>
Wed, 14 Sep 2022 09:27:07 +0000 (11:27 +0200)
committerClément Chigot <chigot@adacore.com>
Thu, 22 Sep 2022 07:23:18 +0000 (09:23 +0200)
OFILES are normally provided through an environment variable set by
Makefiles. However, when launching the testsuite directly through
runtest outside the build tree, it can be hard to retrieve them.
Thus, they can be missing.
Instead of letting tcl raise an error when trying to access this
OFILES variable, skip bootstrap.exp if it doesn't exist.

ld/ChangeLog:

* testsuite/ld-bootstrap/bootstrap.exp: Skip if OFILES is
missing

ld/testsuite/ld-bootstrap/bootstrap.exp

index f6d38af5d4090a4ad278ca4eab0e3db405a1bca6..52a91fc554e8da9321bdf65970f34116bedd33ff 100644 (file)
@@ -29,6 +29,12 @@ if ![isnative] {
     return
 }
 
+# Skip if OFILES aren't provided, it can happen when lauching
+# the testsuites outside the build directory.
+if {![info exists OFILES]} {
+    return
+}
+
 # Skip for -fprofile-generate=.
 catch "exec $nm $plug_opt $OFILES" exec_output
 send_log "foo: $exec_output"