authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-30 12:35:09-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-30 12:37:00-07:00
log718a659773776de47e8ce6ba80da663539572056
tree8926f6b2fa2852af444f01682bb2012c4fce5ad8
parentfe117d9961c3622fda5c359733d01de686509af0

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 files changed, 15 insertions(+), 0 deletions(-)

lib/std/packed_int_array.zig+15
...@@ -318,9 +318,12 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: builtin.Endian)...@@ -318,9 +318,12 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: builtin.Endian)
318 };318 };
319}319}
320320
321const we_are_testing_this_with_stage1_which_leaks_comptime_memory = true;
322
321test "PackedIntArray" {323test "PackedIntArray" {
322 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.324 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.
323 if (builtin.arch == .wasm32) return error.SkipZigTest;325 if (builtin.arch == .wasm32) return error.SkipZigTest;
326 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
324327
325 @setEvalBranchQuota(10000);328 @setEvalBranchQuota(10000);
326 const max_bits = 256;329 const max_bits = 256;
...@@ -358,6 +361,7 @@ test "PackedIntArray" {...@@ -358,6 +361,7 @@ test "PackedIntArray" {
358}361}
359362
360test "PackedIntArray init" {363test "PackedIntArray init" {
364 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
361 const PackedArray = PackedIntArray(u3, 8);365 const PackedArray = PackedIntArray(u3, 8);
362 var packed_array = PackedArray.init([_]u3{ 0, 1, 2, 3, 4, 5, 6, 7 });366 var packed_array = PackedArray.init([_]u3{ 0, 1, 2, 3, 4, 5, 6, 7 });
363 var i = @as(usize, 0);367 var i = @as(usize, 0);
...@@ -367,6 +371,7 @@ test "PackedIntArray init" {...@@ -367,6 +371,7 @@ test "PackedIntArray init" {
367test "PackedIntSlice" {371test "PackedIntSlice" {
368 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.372 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.
369 if (builtin.arch == .wasm32) return error.SkipZigTest;373 if (builtin.arch == .wasm32) return error.SkipZigTest;
374 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
370375
371 @setEvalBranchQuota(10000);376 @setEvalBranchQuota(10000);
372 const max_bits = 256;377 const max_bits = 256;
...@@ -405,6 +410,7 @@ test "PackedIntSlice" {...@@ -405,6 +410,7 @@ test "PackedIntSlice" {
405}410}
406411
407test "PackedIntSlice of PackedInt(Array/Slice)" {412test "PackedIntSlice of PackedInt(Array/Slice)" {
413 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
408 const max_bits = 16;414 const max_bits = 16;
409 const int_count = 19;415 const int_count = 19;
410416
...@@ -470,6 +476,7 @@ test "PackedIntSlice of PackedInt(Array/Slice)" {...@@ -470,6 +476,7 @@ test "PackedIntSlice of PackedInt(Array/Slice)" {
470}476}
471477
472test "PackedIntSlice accumulating bit offsets" {478test "PackedIntSlice accumulating bit offsets" {
479 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
473 //bit_offset is u3, so standard debugging asserts should catch480 //bit_offset is u3, so standard debugging asserts should catch
474 // anything481 // anything
475 {482 {
...@@ -497,6 +504,8 @@ test "PackedIntSlice accumulating bit offsets" {...@@ -497,6 +504,8 @@ test "PackedIntSlice accumulating bit offsets" {
497//@NOTE: As I do not have a big endian system to test this on,504//@NOTE: As I do not have a big endian system to test this on,
498// big endian values were not tested505// big endian values were not tested
499test "PackedInt(Array/Slice) sliceCast" {506test "PackedInt(Array/Slice) sliceCast" {
507 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
508
500 const PackedArray = PackedIntArray(u1, 16);509 const PackedArray = PackedIntArray(u1, 16);
501 var packed_array = PackedArray.init([_]u1{ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 });510 var packed_array = PackedArray.init([_]u1{ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 });
502 const packed_slice_cast_2 = packed_array.sliceCast(u2);511 const packed_slice_cast_2 = packed_array.sliceCast(u2);
...@@ -537,6 +546,8 @@ test "PackedInt(Array/Slice) sliceCast" {...@@ -537,6 +546,8 @@ test "PackedInt(Array/Slice) sliceCast" {
537}546}
538547
539test "PackedInt(Array/Slice)Endian" {548test "PackedInt(Array/Slice)Endian" {
549 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
550
540 {551 {
541 const PackedArrayBe = PackedIntArrayEndian(u4, .Big, 8);552 const PackedArrayBe = PackedIntArrayEndian(u4, .Big, 8);
542 var packed_array_be = PackedArrayBe.init([_]u4{ 0, 1, 2, 3, 4, 5, 6, 7 });553 var packed_array_be = PackedArrayBe.init([_]u4{ 0, 1, 2, 3, 4, 5, 6, 7 });
...@@ -604,6 +615,8 @@ test "PackedInt(Array/Slice)Endian" {...@@ -604,6 +615,8 @@ test "PackedInt(Array/Slice)Endian" {
604// after this one is not mapped and will cause a segfault if we615// after this one is not mapped and will cause a segfault if we
605// don't account for the bounds.616// don't account for the bounds.
606test "PackedIntArray at end of available memory" {617test "PackedIntArray at end of available memory" {
618 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
619
607 switch (builtin.os.tag) {620 switch (builtin.os.tag) {
608 .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},621 .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},
609 else => return,622 else => return,
...@@ -623,6 +636,8 @@ test "PackedIntArray at end of available memory" {...@@ -623,6 +636,8 @@ test "PackedIntArray at end of available memory" {
623}636}
624637
625test "PackedIntSlice at end of available memory" {638test "PackedIntSlice at end of available memory" {
639 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
640
626 switch (builtin.os.tag) {641 switch (builtin.os.tag) {
627 .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},642 .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},
628 else => return,643 else => return,