testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not avail
authorTobias Burnus <tobias@codesourcery.com>
Fri, 30 Oct 2020 16:11:20 +0000 (17:11 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 30 Oct 2020 16:11:20 +0000 (17:11 +0100)
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
gcc/testsuite/gcc.dg/guality/guality.exp
gcc/testsuite/gfortran.dg/guality/guality.exp
gcc/testsuite/lib/asan-dg.exp
gcc/testsuite/lib/tsan-dg.exp
gcc/testsuite/lib/ubsan-dg.exp

index 33571f1f28fec92a421fd93550fbebecf18f6774..1d5b65fef570bed9050c6afdd346d7da153c276e 100644 (file)
@@ -38,7 +38,7 @@ global GDB
 if ![info exists ::env(GUALITY_GDB_NAME)] {
     if [info exists GDB] {
        set guality_gdb_name "$GDB"
-    } elseif [file exists $rootme/../gdb/gdb] {
+    } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } {
        # If we're doing a combined build, and gdb is available, use it.
        set guality_gdb_name "$rootme/../gdb/gdb"
     } else {
index 89cd896d05c3457fa8cca7f9be490bf96a8f1a07..ba87132aef2cab51f08ef71b7ce06630ba0e8088 100644 (file)
@@ -38,7 +38,7 @@ global GDB
 if ![info exists ::env(GUALITY_GDB_NAME)] {
     if [info exists GDB] {
        set guality_gdb_name "$GDB"
-    } elseif [file exists $rootme/../gdb/gdb] {
+    } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } {
        # If we're doing a combined build, and gdb is available, use it.
        set guality_gdb_name "$rootme/../gdb/gdb"
     } else {
index eaa7ae770d63b0f133f8474a366f94621e864ba3..0375edfffe4b92e452ff40a85d76e6e2f6885b5d 100644 (file)
@@ -19,7 +19,7 @@ global GDB
 if ![info exists ::env(GUALITY_GDB_NAME)] {
     if [info exists GDB] {
        set guality_gdb_name "$GDB"
-    } elseif [file exists $rootme/../gdb/gdb] {
+    } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } {
        # If we're doing a combined build, and gdb is available, use it.
        set guality_gdb_name "$rootme/../gdb/gdb"
     } else {
index 2124607245ef1068e5ddf234cf45f1c8b70ddf18..ce745dfdf8d34a03a7c8008d2e7faf7a223658ec 100644 (file)
@@ -151,8 +151,10 @@ proc asan_finish { args } {
            unset TEST_ALWAYS_FLAGS
        }
     }
-    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
+    }
     clear_effective_target_cache
 }
 
index b5631a79bcf7f07361b9faa6bdd37e6ccf7a6409..6dcfd0a2f83a9bad51a68b1c2965c89d79e9f345 100644 (file)
@@ -150,7 +150,9 @@ proc tsan_finish { args } {
     } else {
        unset dg-do-what-default
     }
-    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
+    }
     clear_effective_target_cache
 }
index f4ab29e2add026c04030b47a43fabe58d68d4b0c..31740e02ab412238a3f9c481d7a1103bbccb5f30 100644 (file)
@@ -141,7 +141,9 @@ proc ubsan_finish { args } {
            unset TEST_ALWAYS_FLAGS
        }
     }
-    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
+    }
     clear_effective_target_cache
 }