From bf56cdd9edffd5b97d2084b46cda6e6a89a391c1 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 8 Jul 2020 21:01:13 -0700 Subject: start to make test runner aware of logging by default the test runner will only print logs with "warning" or higher. this can be configured via the std.testing API. See #5738 for future plans --- lib/std/testing.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/std/testing.zig') diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 670d8fd5d6..bdaf759d62 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -14,6 +14,9 @@ pub var failing_allocator_instance = FailingAllocator.init(&base_allocator_insta pub var base_allocator_instance = std.mem.validationWrap(std.heap.ThreadSafeFixedBufferAllocator.init(allocator_mem[0..])); var allocator_mem: [2 * 1024 * 1024]u8 = undefined; +/// TODO https://github.com/ziglang/zig/issues/5738 +pub var log_level = std.log.Level.warn; + /// This function is intended to be used only in tests. It prints diagnostics to stderr /// and then aborts when actual_error_union is not expected_error. pub fn expectError(expected_error: anyerror, actual_error_union: var) void { -- cgit v1.2.3