aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-03-28 10:22:48 +0200
committerTom de Vries <tdevries@suse.de>2023-03-28 10:22:48 +0200
commitd7f0f10189fa83a73d9819e81fd321142c0c6398 (patch)
tree0c530f2227dd936bb994f3188279df669f5f2de7
parent29dd2d27b202cb4f16c77008e8b71b5554b435fc (diff)
downloadgdb-d7f0f10189fa83a73d9819e81fd321142c0c6398.zip
gdb-d7f0f10189fa83a73d9819e81fd321142c0c6398.tar.gz
gdb-d7f0f10189fa83a73d9819e81fd321142c0c6398.tar.bz2
[gdb/testsuite] Allow gdb.rust/expr.exp without rust compiler
Proc allow_rust_tests returns 0 when there's no rust compiler, but that gives the wrong answer for gdb.rust/expr.exp, which doesn't require it. Fix this by using can_compile rust in the test-cases that need it, and just returning 1 in allow_rust_tests. Tested on x86_64-linux.
-rw-r--r--gdb/testsuite/gdb.rust/completion.exp1
-rw-r--r--gdb/testsuite/gdb.rust/dwindex.exp1
-rw-r--r--gdb/testsuite/gdb.rust/finish.exp1
-rw-r--r--gdb/testsuite/gdb.rust/fnfield.exp1
-rw-r--r--gdb/testsuite/gdb.rust/generics.exp1
-rw-r--r--gdb/testsuite/gdb.rust/main-crash.exp1
-rw-r--r--gdb/testsuite/gdb.rust/methods.exp1
-rw-r--r--gdb/testsuite/gdb.rust/modules.exp1
-rw-r--r--gdb/testsuite/gdb.rust/onetwoeight.exp1
-rw-r--r--gdb/testsuite/gdb.rust/pp.exp1
-rw-r--r--gdb/testsuite/gdb.rust/rawids.exp1
-rw-r--r--gdb/testsuite/gdb.rust/rust-start.exp1
-rw-r--r--gdb/testsuite/gdb.rust/rust-style.exp1
-rw-r--r--gdb/testsuite/gdb.rust/simple.exp1
-rw-r--r--gdb/testsuite/gdb.rust/traits.exp1
-rw-r--r--gdb/testsuite/gdb.rust/unicode.exp1
-rw-r--r--gdb/testsuite/gdb.rust/union.exp1
-rw-r--r--gdb/testsuite/gdb.rust/unsized.exp1
-rw-r--r--gdb/testsuite/gdb.rust/watch.exp1
-rw-r--r--gdb/testsuite/lib/gdb.exp4
20 files changed, 19 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.rust/completion.exp b/gdb/testsuite/gdb.rust/completion.exp
index 8876395..76c45fd 100644
--- a/gdb/testsuite/gdb.rust/completion.exp
+++ b/gdb/testsuite/gdb.rust/completion.exp
@@ -18,6 +18,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/dwindex.exp b/gdb/testsuite/gdb.rust/dwindex.exp
index 841db21..1a82c2e 100644
--- a/gdb/testsuite/gdb.rust/dwindex.exp
+++ b/gdb/testsuite/gdb.rust/dwindex.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
diff --git a/gdb/testsuite/gdb.rust/finish.exp b/gdb/testsuite/gdb.rust/finish.exp
index ab0250d..373f8d7 100644
--- a/gdb/testsuite/gdb.rust/finish.exp
+++ b/gdb/testsuite/gdb.rust/finish.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/fnfield.exp b/gdb/testsuite/gdb.rust/fnfield.exp
index 5ae0c53..48c6179 100644
--- a/gdb/testsuite/gdb.rust/fnfield.exp
+++ b/gdb/testsuite/gdb.rust/fnfield.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/generics.exp b/gdb/testsuite/gdb.rust/generics.exp
index 41112af..7afed99 100644
--- a/gdb/testsuite/gdb.rust/generics.exp
+++ b/gdb/testsuite/gdb.rust/generics.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/main-crash.exp b/gdb/testsuite/gdb.rust/main-crash.exp
index 9c513f9..caede88 100644
--- a/gdb/testsuite/gdb.rust/main-crash.exp
+++ b/gdb/testsuite/gdb.rust/main-crash.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile main.rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
diff --git a/gdb/testsuite/gdb.rust/methods.exp b/gdb/testsuite/gdb.rust/methods.exp
index 72be6a1..dd95429 100644
--- a/gdb/testsuite/gdb.rust/methods.exp
+++ b/gdb/testsuite/gdb.rust/methods.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/modules.exp b/gdb/testsuite/gdb.rust/modules.exp
index 0ad1a4a..076ef5c 100644
--- a/gdb/testsuite/gdb.rust/modules.exp
+++ b/gdb/testsuite/gdb.rust/modules.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/onetwoeight.exp b/gdb/testsuite/gdb.rust/onetwoeight.exp
index 317c848..ef56bca 100644
--- a/gdb/testsuite/gdb.rust/onetwoeight.exp
+++ b/gdb/testsuite/gdb.rust/onetwoeight.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
set v [split [rust_compiler_version] .]
if {[lindex $v 0] == 1 && [lindex $v 1] < 43} {
diff --git a/gdb/testsuite/gdb.rust/pp.exp b/gdb/testsuite/gdb.rust/pp.exp
index 553bce3..ef66717 100644
--- a/gdb/testsuite/gdb.rust/pp.exp
+++ b/gdb/testsuite/gdb.rust/pp.exp
@@ -18,6 +18,7 @@
load_lib gdb-python.exp
load_lib rust-support.exp
require allow_rust_tests allow_python_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/rawids.exp b/gdb/testsuite/gdb.rust/rawids.exp
index 976b723..56d1e5f 100644
--- a/gdb/testsuite/gdb.rust/rawids.exp
+++ b/gdb/testsuite/gdb.rust/rawids.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
set v [split [rust_compiler_version] .]
if {[lindex $v 0] == 1 && [lindex $v 1] < 30} {
diff --git a/gdb/testsuite/gdb.rust/rust-start.exp b/gdb/testsuite/gdb.rust/rust-start.exp
index 96ba2ae..ca26084 100644
--- a/gdb/testsuite/gdb.rust/rust-start.exp
+++ b/gdb/testsuite/gdb.rust/rust-start.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
# This testcase verifies the behavior of the `start' command, which
# does not work when we use the gdb stub...
diff --git a/gdb/testsuite/gdb.rust/rust-style.exp b/gdb/testsuite/gdb.rust/rust-style.exp
index c942673..0555ea4 100644
--- a/gdb/testsuite/gdb.rust/rust-style.exp
+++ b/gdb/testsuite/gdb.rust/rust-style.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
save_vars { env(TERM) } {
# We need an ANSI-capable terminal to get the output.
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 25152a3..08ebed3 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/traits.exp b/gdb/testsuite/gdb.rust/traits.exp
index 9aa4cbf..e527497 100644
--- a/gdb/testsuite/gdb.rust/traits.exp
+++ b/gdb/testsuite/gdb.rust/traits.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/unicode.exp b/gdb/testsuite/gdb.rust/unicode.exp
index 2b4766b..7124934 100644
--- a/gdb/testsuite/gdb.rust/unicode.exp
+++ b/gdb/testsuite/gdb.rust/unicode.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
# Non-ASCII identifiers were allowed starting in 1.53.
set v [split [rust_compiler_version] .]
diff --git a/gdb/testsuite/gdb.rust/union.exp b/gdb/testsuite/gdb.rust/union.exp
index 5f128c5..6074717 100644
--- a/gdb/testsuite/gdb.rust/union.exp
+++ b/gdb/testsuite/gdb.rust/union.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/unsized.exp b/gdb/testsuite/gdb.rust/unsized.exp
index f81be8a3..a12d8f0 100644
--- a/gdb/testsuite/gdb.rust/unsized.exp
+++ b/gdb/testsuite/gdb.rust/unsized.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/watch.exp b/gdb/testsuite/gdb.rust/watch.exp
index 43c88f8..ae35942 100644
--- a/gdb/testsuite/gdb.rust/watch.exp
+++ b/gdb/testsuite/gdb.rust/watch.exp
@@ -17,6 +17,7 @@
load_lib rust-support.exp
require allow_rust_tests
+require {can_compile rust}
standard_testfile .rs
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 769bb28..46aa1441 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2503,10 +2503,6 @@ gdb_caching_proc can_compile { lang } {
# Return 1 to try Rust tests, 0 to skip them.
proc allow_rust_tests {} {
- if { ![can_compile rust] } {
- return 0
- }
-
return 1
}