mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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
@@ -6,7 +6,7 @@
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/operators/fail_combine_lhs.carbon:[[@LINE+1]]: expected a constraint in first operand of `&`, found i32
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_combine_lhs.carbon:[[@LINE+1]]: expected a constraint in first operand of `&`, found i32
|
||||
fn F[T:! i32 & type]();
|
||||
|
||||
fn Main() -> i32 {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ package ExplorerTest api;
|
||||
|
||||
class C {}
|
||||
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/operators/fail_combine_rhs.carbon:[[@LINE+1]]: expected a constraint in second operand of `&`, found class C
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_combine_rhs.carbon:[[@LINE+1]]: expected a constraint in second operand of `&`, found class C
|
||||
fn F[T:! type & C]();
|
||||
|
||||
fn Main() -> i32 {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/testdata/operators/fail_div_by_zero.carbon:[[@LINE+1]]: division by zero
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_div_by_zero.carbon:[[@LINE+1]]: division by zero
|
||||
var a: auto = 5 / 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/testdata/operators/fail_mod_by_zero.carbon:[[@LINE+1]]: division by zero
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_mod_by_zero.carbon:[[@LINE+1]]: division by zero
|
||||
var a: auto = 5 % 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class A {}
|
||||
|
||||
fn Main() -> i32 {
|
||||
var a: A = {};
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/operators/fail_no_add.carbon:[[@LINE+2]]: type error in `+`:
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_no_add.carbon:[[@LINE+2]]: type error in `+`:
|
||||
// CHECK:STDERR: could not find implementation of interface AddWith(U = i32) for class A
|
||||
a + 1;
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class A {}
|
||||
|
||||
fn Main() -> i32 {
|
||||
var a: A = {};
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/operators/fail_no_mul.carbon:[[@LINE+2]]: type error in `*`:
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_no_mul.carbon:[[@LINE+2]]: type error in `*`:
|
||||
// CHECK:STDERR: could not find implementation of interface MulWith(U = i32) for class A
|
||||
a * 1;
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class A {}
|
||||
|
||||
fn Main() -> i32 {
|
||||
var a: A = {};
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/operators/fail_no_negate.carbon:[[@LINE+2]]: type error in `-`:
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_no_negate.carbon:[[@LINE+2]]: type error in `-`:
|
||||
// CHECK:STDERR: could not find implementation of interface Negate for class A
|
||||
-a;
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class A {}
|
||||
|
||||
fn Main() -> i32 {
|
||||
var a: A = {};
|
||||
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/operators/fail_no_sub.carbon:[[@LINE+2]]: type error in `-`:
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_no_sub.carbon:[[@LINE+2]]: type error in `-`:
|
||||
// CHECK:STDERR: could not find implementation of interface SubWith(U = i32) for class A
|
||||
a - 1;
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/testdata/operators/fail_overflow_add.carbon:[[@LINE+1]]: integer overflow
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_overflow_add.carbon:[[@LINE+1]]: integer overflow
|
||||
var a: auto = 2147483647 + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/testdata/operators/fail_overflow_div.carbon:[[@LINE+1]]: integer overflow
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_overflow_div.carbon:[[@LINE+1]]: integer overflow
|
||||
var a: auto = (-2147483647 -1) /-1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/testdata/operators/fail_overflow_multiply.carbon:[[@LINE+1]]: integer overflow
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_overflow_multiply.carbon:[[@LINE+1]]: integer overflow
|
||||
var a: auto = 1000000000 * 1000000000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/testdata/operators/fail_overflow_sub.carbon:[[@LINE+1]]: integer overflow
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_overflow_sub.carbon:[[@LINE+1]]: integer overflow
|
||||
var a: auto = -2147483647 - 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDERR: RUNTIME ERROR: explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user