mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:31:05 +01:00
Provide local paths for file tests. (#2830)
The intent of this change is that instead of paths looking like `explorer/testdata/foo/bar.carbon` (repo-relative), they're now just `bar.carbon` (local). The consequence is that paths should be a bit more durable in various environments, and just paths should be shorter and easier to read. The explorer's prelude is an exception to this since it comes from data, rather than being the test target. Due to the change in approaches, it needs the regex again. Uses #2829
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/data/prelude.carbon:{{.*}}: "HALLO WELT"
|
||||
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/data/prelude.carbon:{{.*}}: "HALLO WELT"
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/data/prelude.carbon:{{.*}}: "Fail"
|
||||
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/data/prelude.carbon:{{.*}}: "Fail"
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class ConvertTo(T:! type) {
|
||||
}
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: SYNTAX ERROR: explorer/testdata/assert/fail_intrinsic_bool_type.carbon:[[@LINE+1]]: syntax error, unexpected COMMA
|
||||
// CHECK:STDERR: SYNTAX ERROR: fail_intrinsic_bool_type.carbon:[[@LINE+1]]: syntax error, unexpected COMMA
|
||||
__intrinsic_assert(, "unused");
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class ConvertTo(T:! type) {
|
||||
}
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/assert/fail_intrinsic_no_args.carbon:[[@LINE+1]]: __intrinsic_assert takes 2 arguments
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_intrinsic_no_args.carbon:[[@LINE+1]]: __intrinsic_assert takes 2 arguments
|
||||
__intrinsic_assert();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class ConvertTo(T:! type) {
|
||||
}
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/assert/fail_intrinsic_no_convert.carbon:[[@LINE+3]]: type error in __intrinsic_assert argument 0
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_intrinsic_no_convert.carbon:[[@LINE+3]]: type error in __intrinsic_assert argument 0
|
||||
// CHECK:STDERR: expected: bool
|
||||
// CHECK:STDERR: actual: class ConvertTo(T = bool)
|
||||
__intrinsic_assert({.v = true} as ConvertTo(bool), {.v = "Pass"} as ConvertTo(String));
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class ConvertTo(T:! type) {
|
||||
}
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/assert/fail_intrinsic_str_type.carbon:[[@LINE+3]]: type error in __intrinsic_assert argument 1
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_intrinsic_str_type.carbon:[[@LINE+3]]: type error in __intrinsic_assert argument 1
|
||||
// CHECK:STDERR: expected: String
|
||||
// CHECK:STDERR: actual: i32
|
||||
__intrinsic_assert(true, 1);
|
||||
|
||||
Reference in New Issue
Block a user