Commit 134853f106

Andrew Kelley <andrew@ziglang.org>
2021-05-14 05:44:34
stage2: fix tests expected values
1 parent 5796948
Changed files (3)
test/stage2/darwin.zig
@@ -13,13 +13,17 @@ pub fn addCases(ctx: *TestContext) !void {
         };
         {
             var case = ctx.exe("hello world with updates", target);
-            case.addError("", &[_][]const u8{"error: no entry point found"});
+            case.addError("", &[_][]const u8{
+                ":84:9: error: struct 'test_case.test_case' has no member named 'main'",
+            });
 
             // Incorrect return type
             case.addError(
                 \\pub export fn _start() noreturn {
                 \\}
-            , &[_][]const u8{":2:1: error: expected noreturn, found void"});
+            , &[_][]const u8{
+                ":2:1: error: expected noreturn, found void",
+            });
 
             // Regular old hello world
             case.addCompareOutput(
test/stage2/test.zig
@@ -24,7 +24,9 @@ pub fn addCases(ctx: *TestContext) !void {
     {
         var case = ctx.exe("hello world with updates", linux_x64);
 
-        case.addError("", &[_][]const u8{"error: no entry point found"});
+        case.addError("", &[_][]const u8{
+            ":84:9: error: struct 'test_case.test_case' has no member named 'main'",
+        });
 
         // Incorrect return type
         case.addError(
@@ -321,7 +323,7 @@ pub fn addCases(ctx: *TestContext) !void {
     {
         var case = ctx.exe("multiplying numbers at runtime and comptime", linux_x64);
         case.addCompareOutput(
-            \\export fn _start() noreturn {
+            \\pub export fn _start() noreturn {
             \\    mul(3, 4);
             \\
             \\    exit();
@@ -345,7 +347,7 @@ pub fn addCases(ctx: *TestContext) !void {
         );
         // comptime function call
         case.addCompareOutput(
-            \\export fn _start() noreturn {
+            \\pub export fn _start() noreturn {
             \\    exit();
             \\}
             \\
@@ -369,7 +371,7 @@ pub fn addCases(ctx: *TestContext) !void {
         );
         // Inline function call
         case.addCompareOutput(
-            \\export fn _start() noreturn {
+            \\pub export fn _start() noreturn {
             \\    var x: usize = 5;
             \\    const y = mul(2, 3, x);
             \\    exit(y - 30);
BRANCH_TODO
@@ -1,4 +1,10 @@
  * get stage2 tests passing
+   - after the error from an empty file, "has no member main" is invalidated
+     but the comptime block incorrectly does not get re-run
+   - redundant comptime wrong source loc
+   - redeclaration of 'foo' not showing 'previously declared here'
+   - segfault in one of the tests
+   - memory leaks
  * modify stage2 tests so that only 1 uses _start and the rest use
    pub fn main
  * modify stage2 CBE tests so that only 1 uses pub export main and the