]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Improve path handling while testing name resolution 2.0
authorOwen Avery <powerboat9.gamer@gmail.com>
Thu, 17 Oct 2024 00:18:48 +0000 (20:18 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Fri, 21 Mar 2025 11:32:54 +0000 (12:32 +0100)
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 <powerboat9.gamer@gmail.com>
gcc/testsuite/rust/compile/nr2/compile.exp
gcc/testsuite/rust/compile/nr2/exclude

index 0afe36c3c40365c6bff0c615b56b4087b8abd8ef..f2724f6c45442a13d62a5f347fb6111150e8e28d 100644 (file)
@@ -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]
            }
        }
index 57bcca0a60e589b5de019b333340bffd1e10bc37..450fc254452d6b9093c04b5815d58d8327d3e789 100644 (file)
@@ -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