@@ -47,18 +47,22 @@ namespace eval rust-nr2-ns {
47
47
set tests_expect_ok ""
48
48
set tests_expect_err ""
49
49
50
+ set compile_dir [list {*}[file split $srcdir] {*}[file split $subdir]]
51
+ set compile_dir [lreplace $compile_dir end end]
52
+
50
53
foreach test_dir $test_dirs {
51
- set directory [list {*}[file split $srcdir] {*}[file split $subdir]]
52
- set directory [lreplace $directory end end]
53
- set directory [list {*}$directory {*}$test_dir]
54
- foreach test [lsort [glob -nocomplain -tails -directory [file join {*}$directory] *.rs]] {
54
+ foreach test [lsort [glob -nocomplain -tails -directory [file join {*}$compile_dir {*}$test_dir] *.rs]] {
55
55
# use '/' as the path seperator for entries in the exclude file
56
56
set test_lbl [join [list {*}$test_dir $test] "/"]
57
57
set idx [lsearch -exact -sorted $exclude $test_lbl]
58
58
if {$idx == -1} {
59
- lappend tests_expect_ok [file join {*}$directory $test]
59
+ if {[runtest_file_p $runtests [file join {*}$compile_dir {*}$test_dir $test]]} {
60
+ lappend tests_expect_ok [list {*}$test_dir $test]
61
+ }
60
62
} else {
61
- lappend tests_expect_err [file join {*}$directory $test]
63
+ if {[runtest_file_p $runtests [file join {*}$compile_dir {*}$test_dir $test]]} {
64
+ lappend tests_expect_err [list {*}$test_dir $test]
65
+ }
62
66
set exclude [lreplace $exclude $idx $idx]
63
67
}
64
68
}
@@ -83,10 +87,10 @@ namespace eval rust-nr2-ns {
83
87
variable record_test_out
84
88
switch $type {
85
89
FAIL {
86
- lappend record_test_out " $type: $msg"
90
+ lappend record_test_out [list $type $msg]
87
91
}
88
92
XPASS {
89
- lappend record_test_out " $type: $msg"
93
+ lappend record_test_out [list $type $msg]
90
94
}
91
95
}
92
96
}
@@ -109,23 +113,23 @@ namespace eval rust-nr2-ns {
109
113
110
114
# check for unexpected failures
111
115
foreach test $tests_expect_ok {
112
- set fails [try_test $ test]
116
+ set fails [try_test [file join {*}$compile_dir {*}$ test] ]
113
117
if {[llength $fails] != 0} {
114
118
foreach ent $fails {
115
- record_test FAIL "$test: nr2 failure: $ent"
119
+ record_test [lindex $ent 0] "on nr2: [lindex $ent 1] "
116
120
}
117
121
} else {
118
- record_test PASS "$test: nr2 success "
122
+ record_test PASS "[file join {*} $test] on nr2 "
119
123
}
120
124
}
121
125
122
126
#check for unexpected successes
123
127
foreach test $tests_expect_err {
124
- set fails [try_test $ test]
128
+ set fails [try_test [file join {*}$compile_dir {*}$ test] ]
125
129
if {[llength $fails] == 0} {
126
- record_test XPASS "$test: nr2 unexpectedly passed "
130
+ record_test XPASS "[file join {*} $test] on nr2 "
127
131
} else {
128
- record_test XFAIL "$test: nr2 was rightfully excluded"
132
+ record_test XFAIL "[file join {*} $test] on nr2 was rightfully excluded"
129
133
}
130
134
}
131
135
}
0 commit comments