| author | |
| committer | |
| log | 02c1b9df3bcf2e0324adf02fd6c0ed56fe58c6d3 |
| tree | ea5605110789b468d204b6c44c9d393c1855d61d |
| parent | c186cd187e9b75ee1514a5f3371abeffb36d871a |
also reduce the aggressiveness of std.atomic.stack
and std.atomic.queue fuzz testing. appveyor has 1 core
and 10,000 iterations is too much for 6 threads to
thrash over15 files changed, 56 insertions(+), 36 deletions(-)
std/atomic/queue.zig+8-2| ... | ... | @@ -49,14 +49,20 @@ const Context = struct { |
| 49 | 49 | get_count: usize, |
| 50 | 50 | puts_done: u8, // TODO make this a bool |
| 51 | 51 | }; |
| 52 | const puts_per_thread = 10000; | |
| 52 | ||
| 53 | // TODO add lazy evaluated build options and then put puts_per_thread behind | |
| 54 | // some option such as: "AggressiveMultithreadedFuzzTest". In the AppVeyor | |
| 55 | // CI we would use a less aggressive setting since at 1 core, while we still | |
| 56 | // want this test to pass, we need a smaller value since there is so much thrashing | |
| 57 | // we would also use a less aggressive setting when running in valgrind | |
| 58 | const puts_per_thread = 500; | |
| 53 | 59 | const put_thread_count = 3; |
| 54 | 60 | |
| 55 | 61 | test "std.atomic.queue" { |
| 56 | 62 | var direct_allocator = std.heap.DirectAllocator.init(); |
| 57 | 63 | defer direct_allocator.deinit(); |
| 58 | 64 | |
| 59 | var plenty_of_memory = try direct_allocator.allocator.alloc(u8, 600 * 1024); | |
| 65 | var plenty_of_memory = try direct_allocator.allocator.alloc(u8, 300 * 1024); | |
| 60 | 66 | defer direct_allocator.allocator.free(plenty_of_memory); |
| 61 | 67 | |
| 62 | 68 | var fixed_buffer_allocator = std.heap.ThreadSafeFixedBufferAllocator.init(plenty_of_memory); |
std/atomic/stack.zig+7-2| ... | ... | @@ -56,14 +56,19 @@ const Context = struct { |
| 56 | 56 | get_count: usize, |
| 57 | 57 | puts_done: u8, // TODO make this a bool |
| 58 | 58 | }; |
| 59 | const puts_per_thread = 1000; | |
| 59 | // TODO add lazy evaluated build options and then put puts_per_thread behind | |
| 60 | // some option such as: "AggressiveMultithreadedFuzzTest". In the AppVeyor | |
| 61 | // CI we would use a less aggressive setting since at 1 core, while we still | |
| 62 | // want this test to pass, we need a smaller value since there is so much thrashing | |
| 63 | // we would also use a less aggressive setting when running in valgrind | |
| 64 | const puts_per_thread = 500; | |
| 60 | 65 | const put_thread_count = 3; |
| 61 | 66 | |
| 62 | 67 | test "std.atomic.stack" { |
| 63 | 68 | var direct_allocator = std.heap.DirectAllocator.init(); |
| 64 | 69 | defer direct_allocator.deinit(); |
| 65 | 70 | |
| 66 | var plenty_of_memory = try direct_allocator.allocator.alloc(u8, 600 * 1024); | |
| 71 | var plenty_of_memory = try direct_allocator.allocator.alloc(u8, 300 * 1024); | |
| 67 | 72 | defer direct_allocator.allocator.free(plenty_of_memory); |
| 68 | 73 | |
| 69 | 74 | var fixed_buffer_allocator = std.heap.ThreadSafeFixedBufferAllocator.init(plenty_of_memory); |
std/special/compiler_rt/fixuint.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const is_test = @import("builtin").is_test; |
| 2 | const Log2Int = @import("../../math/index.zig").Log2Int; | |
| 2 | const Log2Int = @import("std").math.Log2Int; | |
| 3 | 3 | |
| 4 | 4 | pub fn fixuint(comptime fp_t: type, comptime fixuint_t: type, a: fp_t) fixuint_t { |
| 5 | 5 | @setRuntimeSafety(is_test); |
std/special/compiler_rt/fixunsdfdi_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunsdfdi = @import("fixunsdfdi.zig").__fixunsdfdi; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunsdfdi(a: f64, expected: u64) void { |
| 5 | 5 | const x = __fixunsdfdi(a); |
std/special/compiler_rt/fixunsdfsi_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunsdfsi = @import("fixunsdfsi.zig").__fixunsdfsi; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunsdfsi(a: f64, expected: u32) void { |
| 5 | 5 | const x = __fixunsdfsi(a); |
std/special/compiler_rt/fixunsdfti_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunsdfti = @import("fixunsdfti.zig").__fixunsdfti; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunsdfti(a: f64, expected: u128) void { |
| 5 | 5 | const x = __fixunsdfti(a); |
std/special/compiler_rt/fixunssfdi_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunssfdi = @import("fixunssfdi.zig").__fixunssfdi; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunssfdi(a: f32, expected: u64) void { |
| 5 | 5 | const x = __fixunssfdi(a); |
std/special/compiler_rt/fixunssfsi_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunssfsi = @import("fixunssfsi.zig").__fixunssfsi; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunssfsi(a: f32, expected: u32) void { |
| 5 | 5 | const x = __fixunssfsi(a); |
std/special/compiler_rt/fixunssfti_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunssfti = @import("fixunssfti.zig").__fixunssfti; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunssfti(a: f32, expected: u128) void { |
| 5 | 5 | const x = __fixunssfti(a); |
std/special/compiler_rt/fixunstfdi_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunstfdi = @import("fixunstfdi.zig").__fixunstfdi; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunstfdi(a: f128, expected: u64) void { |
| 5 | 5 | const x = __fixunstfdi(a); |
std/special/compiler_rt/fixunstfsi_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunstfsi = @import("fixunstfsi.zig").__fixunstfsi; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunstfsi(a: f128, expected: u32) void { |
| 5 | 5 | const x = __fixunstfsi(a); |
std/special/compiler_rt/fixunstfti_test.zig+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const __fixunstfti = @import("fixunstfti.zig").__fixunstfti; |
| 2 | const assert = @import("../../index.zig").debug.assert; | |
| 2 | const assert = @import("std").debug.assert; | |
| 3 | 3 | |
| 4 | 4 | fn test__fixunstfti(a: f128, expected: u128) void { |
| 5 | 5 | const x = __fixunstfti(a); |
std/special/compiler_rt/index.zig+3-2| ... | ... | @@ -71,7 +71,8 @@ comptime { |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | const assert = @import("../../index.zig").debug.assert; | |
| 74 | const std = @import("std"); | |
| 75 | const assert = std.debug.assert; | |
| 75 | 76 | |
| 76 | 77 | const __udivmoddi4 = @import("udivmoddi4.zig").__udivmoddi4; |
| 77 | 78 | |
| ... | ... | @@ -80,7 +81,7 @@ const __udivmoddi4 = @import("udivmoddi4.zig").__udivmoddi4; |
| 80 | 81 | pub fn panic(msg: []const u8, error_return_trace: ?&builtin.StackTrace) noreturn { |
| 81 | 82 | @setCold(true); |
| 82 | 83 | if (is_test) { |
| 83 | @import("std").debug.panic("{}", msg); | |
| 84 | std.debug.panic("{}", msg); | |
| 84 | 85 | } else { |
| 85 | 86 | unreachable; |
| 86 | 87 | } |
std/special/compiler_rt/udivmod.zig+1-1| ... | ... | @@ -9,7 +9,7 @@ pub fn udivmod(comptime DoubleInt: type, a: DoubleInt, b: DoubleInt, maybe_rem: |
| 9 | 9 | |
| 10 | 10 | const SingleInt = @IntType(false, @divExact(DoubleInt.bit_count, 2)); |
| 11 | 11 | const SignedDoubleInt = @IntType(true, DoubleInt.bit_count); |
| 12 | const Log2SingleInt = @import("../../math/index.zig").Log2Int(SingleInt); | |
| 12 | const Log2SingleInt = @import("std").math.Log2Int(SingleInt); | |
| 13 | 13 | |
| 14 | 14 | const n = *@ptrCast(&const [2]SingleInt, &a); // TODO issue #421 |
| 15 | 15 | const d = *@ptrCast(&const [2]SingleInt, &b); // TODO issue #421 |
std/zig/parser_test.zig+27-19| ... | ... | @@ -1,3 +1,30 @@ |
| 1 | // TODO | |
| 2 | //if (sr > n_uword_bits - 1) // d > r | |
| 3 | // return 0; | |
| 4 | ||
| 5 | // TODO switch with no body | |
| 6 | // format(&size, error{}, countSize, fmt, args) catch |err| switch (err) {}; | |
| 7 | ||
| 8 | ||
| 9 | //TODO | |
| 10 | //test "zig fmt: same-line comptime" { | |
| 11 | // try testCanonical( | |
| 12 | // \\test "" { | |
| 13 | // \\ comptime assert(@typeId(T) == builtin.TypeId.Int); // must pass an integer to absInt | |
| 14 | // \\} | |
| 15 | // \\ | |
| 16 | // ); | |
| 17 | //} | |
| 18 | ||
| 19 | ||
| 20 | //TODO | |
| 21 | //test "zig fmt: number literals" { | |
| 22 | // try testCanonical( | |
| 23 | // \\pub const f64_true_min = 4.94065645841246544177e-324; | |
| 24 | // \\ | |
| 25 | // ); | |
| 26 | //} | |
| 27 | ||
| 1 | 28 | test "zig fmt: line comments in struct initializer" { |
| 2 | 29 | try testCanonical( |
| 3 | 30 | \\fn foo() void { |
| ... | ... | @@ -20,25 +47,6 @@ test "zig fmt: line comments in struct initializer" { |
| 20 | 47 | ); |
| 21 | 48 | } |
| 22 | 49 | |
| 23 | //TODO | |
| 24 | //test "zig fmt: same-line comptime" { | |
| 25 | // try testCanonical( | |
| 26 | // \\test "" { | |
| 27 | // \\ comptime assert(@typeId(T) == builtin.TypeId.Int); // must pass an integer to absInt | |
| 28 | // \\} | |
| 29 | // \\ | |
| 30 | // ); | |
| 31 | //} | |
| 32 | ||
| 33 | ||
| 34 | //TODO | |
| 35 | //test "zig fmt: number literals" { | |
| 36 | // try testCanonical( | |
| 37 | // \\pub const f64_true_min = 4.94065645841246544177e-324; | |
| 38 | // \\ | |
| 39 | // ); | |
| 40 | //} | |
| 41 | ||
| 42 | 50 | test "zig fmt: doc comments before struct field" { |
| 43 | 51 | try testCanonical( |
| 44 | 52 | \\pub const Allocator = struct { |