aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/nr2/compile.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/nr2/compile.exp')
-rw-r--r--gcc/testsuite/rust/compile/nr2/compile.exp38
1 files changed, 20 insertions, 18 deletions
diff --git a/gcc/testsuite/rust/compile/nr2/compile.exp b/gcc/testsuite/rust/compile/nr2/compile.exp
index f2724f6..4d91dd0 100644
--- a/gcc/testsuite/rust/compile/nr2/compile.exp
+++ b/gcc/testsuite/rust/compile/nr2/compile.exp
@@ -14,9 +14,7 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Compile tests, no torture testing, for name resolution 2.0
-#
-# These tests raise errors in the front end; torture testing doesn't apply.
+# Run compile tests with name resolution 2.0 enabled
# Load support procs.
load_lib rust-dg.exp
@@ -44,23 +42,27 @@ namespace eval rust-nr2-ns {
# Run tests in directories
# Manually specifying these, in case some other test file
# does something weird
- set test_dirs {{} {macros builtin} {macros mbe} {macros proc}}
+ set test_dirs {{} {macros builtin} {macros mbe} {macros proc} {torture}}
set tests_expect_ok ""
set tests_expect_err ""
+ set compile_dir [list {*}[file split $srcdir] {*}[file split $subdir]]
+ set compile_dir [lreplace $compile_dir end end]
+
foreach test_dir $test_dirs {
- set directory [list {*}[file split $srcdir] {*}[file split $subdir]]
- set directory [lreplace $directory end end]
- set directory [list {*}$directory {*}$test_dir]
- foreach test [lsort [glob -nocomplain -tails -directory [file join {*}$directory] *.rs]] {
+ foreach test [lsort [glob -nocomplain -tails -directory [file join {*}$compile_dir {*}$test_dir] *.rs]] {
# use '/' as the path seperator for entries in the exclude file
set test_lbl [join [list {*}$test_dir $test] "/"]
set idx [lsearch -exact -sorted $exclude $test_lbl]
if {$idx == -1} {
- lappend tests_expect_ok [file join {*}$directory $test]
+ if {[runtest_file_p $runtests [file join {*}$compile_dir {*}$test_dir $test]]} {
+ lappend tests_expect_ok [list {*}$test_dir $test]
+ }
} else {
- lappend tests_expect_err [file join {*}$directory $test]
+ if {[runtest_file_p $runtests [file join {*}$compile_dir {*}$test_dir $test]]} {
+ lappend tests_expect_err [list {*}$test_dir $test]
+ }
set exclude [lreplace $exclude $idx $idx]
}
}
@@ -85,10 +87,10 @@ namespace eval rust-nr2-ns {
variable record_test_out
switch $type {
FAIL {
- lappend record_test_out "$type: $msg"
+ lappend record_test_out [list $type $msg]
}
XPASS {
- lappend record_test_out "$type: $msg"
+ lappend record_test_out [list $type $msg]
}
}
}
@@ -111,23 +113,23 @@ namespace eval rust-nr2-ns {
# check for unexpected failures
foreach test $tests_expect_ok {
- set fails [try_test $test]
+ set fails [try_test [file join {*}$compile_dir {*}$test]]
if {[llength $fails] != 0} {
foreach ent $fails {
- record_test FAIL "$test: nr2 failure: $ent"
+ record_test [lindex $ent 0] "on nr2: [lindex $ent 1]"
}
} else {
- record_test PASS "$test: nr2 success"
+ record_test PASS "[file join {*}$test] on nr2"
}
}
#check for unexpected successes
foreach test $tests_expect_err {
- set fails [try_test $test]
+ set fails [try_test [file join {*}$compile_dir {*}$test]]
if {[llength $fails] == 0} {
- record_test XPASS "$test: nr2 unexpectedly passed"
+ record_test XPASS "[file join {*}$test] on nr2"
} else {
- record_test XFAIL "$test: nr2 was rightfully excluded"
+ record_test XFAIL "[file join {*}$test] on nr2 was rightfully excluded"
}
}
}