Skip to content

Commit

Permalink
Improve path handling while testing name resolution 2.0
Browse files Browse the repository at this point in the history
gcc/testsuite/ChangeLog:

	* rust/compile/nr2/compile.exp: Handle paths using "file join"
	and "file split".
	* rust/compile/nr2/exclude: Remove debug-diagnostics-on.rs.

Signed-off-by: Owen Avery <[email protected]>
  • Loading branch information
powerboat9 authored and CohenArthur committed Oct 28, 2024
1 parent 98f04ec commit c220250
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
18 changes: 9 additions & 9 deletions gcc/testsuite/rust/compile/nr2/compile.exp
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ namespace eval rust-nr2-ns {
# Run tests in directories
# Manually specifying these, in case some other test file
# does something weird
set test_dirs {. compile macros/builtin macros/mbe macros/proc}
set test_dirs {{} {macros builtin} {macros mbe} {macros proc}}

set tests_expect_ok ""
set tests_expect_err ""

foreach test_dir $test_dirs {
foreach test [lsort [glob -nocomplain -tails -directory $srcdir/$subdir/../$test_dir *.rs]] {
if {$test_dir == "."} {
set test_lbl $test
} else {
set test_lbl "$test_dir/$test"
}
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]] {
# 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 $srcdir/$subdir/../$test_dir/$test
lappend tests_expect_ok [file join {*}$directory $test]
} else {
lappend tests_expect_err $srcdir/$subdir/../$test_dir/$test
lappend tests_expect_err [file join {*}$directory $test]
set exclude [lreplace $exclude $idx $idx]
}
}
Expand Down
5 changes: 0 additions & 5 deletions gcc/testsuite/rust/compile/nr2/exclude
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# relies on exact source file path match
# TODO: patch this file or nr2/compile.exp to handle this
debug-diagnostics-on.rs

# main list
attr-mismatch-crate-name.rs
attr_deprecated.rs
attr_deprecated_2.rs
Expand Down

0 comments on commit c220250

Please sign in to comment.