11 Commits

Author SHA1 Message Date
Veikka Tuominen
a6f254ec3e stage2: fix comptime unreachable 2022-04-30 01:05:48 +03:00
Jakub Konka
62625d9d95 test: migrate stage1 compile error tests to updated test manifest 2022-04-28 18:35:01 +02:00
Jakub Konka
c8d0fb0b21 test: migrate stage2 independent compile errors to test manifest parser 2022-04-28 18:35:01 +02:00
John Schmidt
94fd914e58 Address review comments 2022-04-04 17:03:09 +02:00
John Schmidt
17b804f56b Fix typo in compile error test 2022-04-03 14:30:37 +02:00
John Schmidt
6bbc2cd59a sema: add compile error for duplicate struct field 2022-04-03 14:30:32 +02:00
John Schmidt
174a889364 sema: add compile error for duplicate union field 2022-04-03 14:28:03 +02:00
John Schmidt
fd1ce329b3 stage2: add union compile error tests 2022-04-03 13:49:34 +02:00
Andrew Kelley
243afdcdf5 test harness improvements
* `-Dskip-compile-errors` is removed; `-Dskip-stage1` is added.
 * Use `std.testing.allocator` instead of a new instance of GPA.
   - Fix the memory leaks this revealed.
 * Show the file name when it is not parsed correctly such as when the
   manifest is missing.
   - Better error messages when test files are not parsed correctly.
 * Ignore unknown files such as swap files.
 * Move logic from declarative file to the test harness implementation.
 * Move stage1 tests to stage2 tests where appropriate.
2022-03-31 15:10:31 -07:00
Mitchell Hashimoto
01698528d1
stage2: safety checks for slicing a null C pointer 2022-03-27 09:20:35 -07:00
Cody Tapscott
0568b45779 Move existing compile errors to independent files
Some cases had to stay behind, either because they required complex case
configuration that we don't support in independent files yet, or because
they have associated comments which we don't want to lose track of.

To make sure I didn't drop any tests in the process, I logged all
obj/test/exe test cases from a run of "zig build test" and compared
before/after this change.

All of the test cases match, with two exceptions:
 - "use of comptime-known undefined function value" was deleted, since
   it was a duplicate
 - "slice sentinel mismatch" was renamed to "vector index out of
   bounds", since it was incorrectly named
2022-03-25 12:27:46 -07:00