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:
Jon Ross-Perkins
2023-05-18 10:20:51 -07:00
committed by GitHub
parent 3c15882f4e
commit 6b7a522b3f
495 changed files with 701 additions and 641 deletions
@@ -8,7 +8,7 @@ package ExplorerTest api;
fn Main() -> i32 {
var p: auto = {.x = 0, .y = 0};
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/struct/fail_assign_different_types.carbon:[[@LINE+1]]: could not find implementation of interface AssignWith(U = {.y: i32}) for {.x: i32, .y: i32}
// CHECK:STDERR: COMPILATION ERROR: fail_assign_different_types.carbon:[[@LINE+1]]: could not find implementation of interface AssignWith(U = {.y: i32}) for {.x: i32, .y: i32}
p = {.y = 0};
return 0;
}
+1 -1
View File
@@ -19,7 +19,7 @@ external impl {.x: i32, .y: i32} as EqWith(Self) {
fn Main() -> i32 {
var t1: {.x: i32, .y: i32} = {.x = 5, .y = 2};
var t2: {.x: i32,} = {.x = 5,};
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/struct/fail_equality_type.carbon:[[@LINE+1]]: {.x: i32, .y: i32} is not equality comparable with {.x: i32} (could not find implementation of interface EqWith(U = {.x: i32}) for {.x: i32, .y: i32})
// CHECK:STDERR: COMPILATION ERROR: fail_equality_type.carbon:[[@LINE+1]]: {.x: i32, .y: i32} is not equality comparable with {.x: i32} (could not find implementation of interface EqWith(U = {.x: i32}) for {.x: i32, .y: i32})
if (t1 == t2) {
return 1;
} else {
+1 -1
View File
@@ -7,6 +7,6 @@
package ExplorerTest api;
fn Main() -> i32 {
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/struct/fail_field_access_mismatch.carbon:[[@LINE+1]]: struct {.x: i32, .y: i32} does not have a field named z
// CHECK:STDERR: COMPILATION ERROR: fail_field_access_mismatch.carbon:[[@LINE+1]]: struct {.x: i32, .y: i32} does not have a field named z
return {.x = 1, .y = 2}.z - 1;
}
@@ -7,7 +7,7 @@
package ExplorerTest api;
fn Main() -> i32 {
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/struct/fail_struct_literal_duplicate_member.carbon:[[@LINE+1]]: Duplicate name `x` in struct literal
// CHECK:STDERR: COMPILATION ERROR: fail_struct_literal_duplicate_member.carbon:[[@LINE+1]]: Duplicate name `x` in struct literal
var x: auto = {.x = 0, .x = 0};
return 0;
}
@@ -7,7 +7,7 @@
package ExplorerTest api;
fn Main() -> i32 {
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/struct/fail_struct_type_literal_duplicate_member.carbon:[[@LINE+1]]: Duplicate name `x` in struct type literal
// CHECK:STDERR: COMPILATION ERROR: fail_struct_type_literal_duplicate_member.carbon:[[@LINE+1]]: Duplicate name `x` in struct type literal
var y: {.x: i32, .x: i32};
return 0;
}