Commit 718a659773

Andrew Kelley <andrew@ziglang.org>
2020-09-30 21:35:09
std: skip some tests that stage1 leaks too much memory with
We can restore these when we have self-hosted available. This is intended to address #6467
1 parent fe117d9
Changed files (1)
lib/std/packed_int_array.zig
@@ -318,9 +318,12 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: builtin.Endian)
     };
 }
 
+const we_are_testing_this_with_stage1_which_leaks_comptime_memory = true;
+
 test "PackedIntArray" {
     // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.
     if (builtin.arch == .wasm32) return error.SkipZigTest;
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
 
     @setEvalBranchQuota(10000);
     const max_bits = 256;
@@ -358,6 +361,7 @@ test "PackedIntArray" {
 }
 
 test "PackedIntArray init" {
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
     const PackedArray = PackedIntArray(u3, 8);
     var packed_array = PackedArray.init([_]u3{ 0, 1, 2, 3, 4, 5, 6, 7 });
     var i = @as(usize, 0);
@@ -367,6 +371,7 @@ test "PackedIntArray init" {
 test "PackedIntSlice" {
     // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.
     if (builtin.arch == .wasm32) return error.SkipZigTest;
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
 
     @setEvalBranchQuota(10000);
     const max_bits = 256;
@@ -405,6 +410,7 @@ test "PackedIntSlice" {
 }
 
 test "PackedIntSlice of PackedInt(Array/Slice)" {
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
     const max_bits = 16;
     const int_count = 19;
 
@@ -470,6 +476,7 @@ test "PackedIntSlice of PackedInt(Array/Slice)" {
 }
 
 test "PackedIntSlice accumulating bit offsets" {
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
     //bit_offset is u3, so standard debugging asserts should catch
     // anything
     {
@@ -497,6 +504,8 @@ test "PackedIntSlice accumulating bit offsets" {
 //@NOTE: As I do not have a big endian system to test this on,
 // big endian values were not tested
 test "PackedInt(Array/Slice) sliceCast" {
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
+
     const PackedArray = PackedIntArray(u1, 16);
     var packed_array = PackedArray.init([_]u1{ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 });
     const packed_slice_cast_2 = packed_array.sliceCast(u2);
@@ -537,6 +546,8 @@ test "PackedInt(Array/Slice) sliceCast" {
 }
 
 test "PackedInt(Array/Slice)Endian" {
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
+
     {
         const PackedArrayBe = PackedIntArrayEndian(u4, .Big, 8);
         var packed_array_be = PackedArrayBe.init([_]u4{ 0, 1, 2, 3, 4, 5, 6, 7 });
@@ -604,6 +615,8 @@ test "PackedInt(Array/Slice)Endian" {
 // after this one is not mapped and will cause a segfault if we
 // don't account for the bounds.
 test "PackedIntArray at end of available memory" {
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
+
     switch (builtin.os.tag) {
         .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},
         else => return,
@@ -623,6 +636,8 @@ test "PackedIntArray at end of available memory" {
 }
 
 test "PackedIntSlice at end of available memory" {
+    if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
+
     switch (builtin.os.tag) {
         .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},
         else => return,