diff mbox series

[committed] – was: [Patch] testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not available

Message ID c6a4c88e-7566-cd57-b196-e679093581ed@codesourcery.com
State New
Headers show
Series [committed] – was: [Patch] testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not available | expand

Commit Message

Tobias Burnus Oct. 30, 2020, 4:14 p.m. UTC
I have now committed it as obvious.

Tobias

On 19.10.20 18:03, Tobias Burnus wrote: [...]
> On 10/19/20 11:46 AM, Tobias Burnus wrote:
>> In a --disable-libsanitizer build, I see errors such as:
>>   g++.sum:ERROR: can't read "asan_saved_library_path": no such
>> variable [...]
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
diff mbox series

Patch

commit 24d762d1435257a8efd242c4a1a476c9b2037c03
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Oct 30 17:11:20 2020 +0100

    testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not avail
    
    gcc/testsuite/
            * g++.dg/guality/guality.exp: Skip $rootme-based check if unset.
            * gcc.dg/guality/guality.exp: Likewise.
            * gfortran.dg/guality/guality.exp: Likewise.
            * lib/asan-dg.exp: Don't use $asan_saved_library_path if not set.
            * lib/tsan-dg.exp: Don't use $tsan_saved_library_path if not set.
            * lib/ubsan-dg.exp: Don't use $ubsan_saved_library_path if not set.
---
 gcc/testsuite/g++.dg/guality/guality.exp      | 2 +-
 gcc/testsuite/gcc.dg/guality/guality.exp      | 2 +-
 gcc/testsuite/gfortran.dg/guality/guality.exp | 2 +-
 gcc/testsuite/lib/asan-dg.exp                 | 6 ++++--
 gcc/testsuite/lib/tsan-dg.exp                 | 6 ++++--
 gcc/testsuite/lib/ubsan-dg.exp                | 6 ++++--
 6 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/gcc/testsuite/g++.dg/guality/guality.exp b/gcc/testsuite/g++.dg/guality/guality.exp
index 33571f1f28f..1d5b65fef57 100644
--- a/gcc/testsuite/g++.dg/guality/guality.exp
+++ b/gcc/testsuite/g++.dg/guality/guality.exp
@@ -41 +41 @@  if ![info exists ::env(GUALITY_GDB_NAME)] {
-    } elseif [file exists $rootme/../gdb/gdb] {
+    } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } {
diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp
index 89cd896d05c..ba87132aef2 100644
--- a/gcc/testsuite/gcc.dg/guality/guality.exp
+++ b/gcc/testsuite/gcc.dg/guality/guality.exp
@@ -41 +41 @@  if ![info exists ::env(GUALITY_GDB_NAME)] {
-    } elseif [file exists $rootme/../gdb/gdb] {
+    } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } {
diff --git a/gcc/testsuite/gfortran.dg/guality/guality.exp b/gcc/testsuite/gfortran.dg/guality/guality.exp
index eaa7ae770d6..0375edfffe4 100644
--- a/gcc/testsuite/gfortran.dg/guality/guality.exp
+++ b/gcc/testsuite/gfortran.dg/guality/guality.exp
@@ -22 +22 @@  if ![info exists ::env(GUALITY_GDB_NAME)] {
-    } elseif [file exists $rootme/../gdb/gdb] {
+    } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } {
diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp
index 2124607245e..ce745dfdf8d 100644
--- a/gcc/testsuite/lib/asan-dg.exp
+++ b/gcc/testsuite/lib/asan-dg.exp
@@ -154,2 +154,4 @@  proc asan_finish { args } {
-    set ld_library_path $asan_saved_library_path
-    set_ld_library_path_env_vars
+    if [info exists asan_saved_library_path ] {
+	set ld_library_path $asan_saved_library_path
+	set_ld_library_path_env_vars
+    }
diff --git a/gcc/testsuite/lib/tsan-dg.exp b/gcc/testsuite/lib/tsan-dg.exp
index b5631a79bcf..6dcfd0a2f83 100644
--- a/gcc/testsuite/lib/tsan-dg.exp
+++ b/gcc/testsuite/lib/tsan-dg.exp
@@ -153,2 +153,4 @@  proc tsan_finish { args } {
-    set ld_library_path $tsan_saved_library_path
-    set_ld_library_path_env_vars
+    if [info exists tsan_saved_library_path ] {
+	set ld_library_path $tsan_saved_library_path
+	set_ld_library_path_env_vars
+    }
diff --git a/gcc/testsuite/lib/ubsan-dg.exp b/gcc/testsuite/lib/ubsan-dg.exp
index f4ab29e2add..31740e02ab4 100644
--- a/gcc/testsuite/lib/ubsan-dg.exp
+++ b/gcc/testsuite/lib/ubsan-dg.exp
@@ -144,2 +144,4 @@  proc ubsan_finish { args } {
-    set ld_library_path $ubsan_saved_library_path
-    set_ld_library_path_env_vars
+    if [info exists ubsan_saved_library_path ] {
+	set ld_library_path $ubsan_saved_library_path
+	set_ld_library_path_env_vars
+    }