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
+1 -1
View File
@@ -8,7 +8,7 @@ package ExplorerTest api;
fn Main() -> i32 {
var p: i32*;
// CHECK:STDERR: RUNTIME ERROR: explorer/testdata/pointer/fail_delete_uninit.carbon:[[@LINE+1]]: undefined behavior: access to uninitialized value Uninit<Placeholder<p>>
// CHECK:STDERR: RUNTIME ERROR: fail_delete_uninit.carbon:[[@LINE+1]]: undefined behavior: access to uninitialized value Uninit<Placeholder<p>>
heap.Delete(p);
return 0;
}
@@ -7,7 +7,7 @@
package ExplorerTest api;
fn Main() -> i32 {
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/pointer/fail_intrinsic_delete_no_args.carbon:[[@LINE+1]]: __intrinsic_delete takes 1 argument
// CHECK:STDERR: COMPILATION ERROR: fail_intrinsic_delete_no_args.carbon:[[@LINE+1]]: __intrinsic_delete takes 1 argument
__intrinsic_delete();
return 0;
}
@@ -8,7 +8,7 @@ package ExplorerTest api;
fn Main() -> i32 {
var x: i32;
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/pointer/fail_intrinsic_delete_type.carbon:[[@LINE+3]]: type error in *
// CHECK:STDERR: COMPILATION ERROR: fail_intrinsic_delete_type.carbon:[[@LINE+3]]: type error in *
// CHECK:STDERR: expected a pointer type
// CHECK:STDERR: actual: i32
__intrinsic_delete(x);
@@ -7,7 +7,7 @@
package ExplorerTest api;
fn Main() -> i32 {
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/pointer/fail_intrinsic_new_no_args.carbon:[[@LINE+1]]: __intrinsic_new takes 1 argument
// CHECK:STDERR: COMPILATION ERROR: fail_intrinsic_new_no_args.carbon:[[@LINE+1]]: __intrinsic_new takes 1 argument
__intrinsic_new();
return 0;
}
@@ -11,7 +11,7 @@ class A {}
fn Main() -> i32 {
var a: A = {};
var b: A* = &a;
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/pointer/fail_invalid_ptr_conversion1.carbon:[[@LINE+1]]: type error in initializer of variable: 'class A*' is not implicitly convertible to 'i32'
// CHECK:STDERR: COMPILATION ERROR: fail_invalid_ptr_conversion1.carbon:[[@LINE+1]]: type error in initializer of variable: 'class A*' is not implicitly convertible to 'i32'
var c: i32 = b;
return 1;
}
@@ -11,7 +11,7 @@ class A {}
fn Main() -> i32 {
var a: i32 = 0;
var b: i32* = &a;
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/pointer/fail_invalid_ptr_conversion2.carbon:[[@LINE+1]]: type error in initializer of variable: 'i32*' is not implicitly convertible to 'class A*'
// CHECK:STDERR: COMPILATION ERROR: fail_invalid_ptr_conversion2.carbon:[[@LINE+1]]: type error in initializer of variable: 'i32*' is not implicitly convertible to 'class A*'
var c: A* = b;
return 1;
}
+1 -1
View File
@@ -8,7 +8,7 @@ package ExplorerTest api;
fn Main() -> i32 {
var x: i32 = 5;
// CHECK:STDERR: COMPILATION ERROR: explorer/testdata/pointer/fail_rvalue_addressof.carbon:[[@LINE+1]]: Argument to & should be a reference expression.
// CHECK:STDERR: COMPILATION ERROR: fail_rvalue_addressof.carbon:[[@LINE+1]]: Argument to & should be a reference expression.
var p: i32* = &5;
return 0;
}
+1 -1
View File
@@ -9,6 +9,6 @@ package ExplorerTest api;
fn Main() -> i32 {
var p: i32* = heap.New(5);
heap.Delete(p);
// CHECK:STDERR: RUNTIME ERROR: explorer/testdata/pointer/fail_use_after_free.carbon:[[@LINE+1]]: undefined behavior: access to dead value 5
// CHECK:STDERR: RUNTIME ERROR: fail_use_after_free.carbon:[[@LINE+1]]: undefined behavior: access to dead value 5
return *p;
}