| ... | @@ -22,10 +22,14 @@ pub var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); | ... | @@ -22,10 +22,14 @@ pub var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); |
| 22 | pub var log_level = std.log.Level.warn; | 22 | pub var log_level = std.log.Level.warn; |
| 23 | | 23 | |
| 24 | fn print(comptime fmt: []const u8, args: anytype) void { | 24 | fn print(comptime fmt: []const u8, args: anytype) void { |
| 25 | // Disable printing in tests for simple backends. | 25 | if (@inComptime()) { |
| 26 | if (builtin.zig_backend == .stage2_spirv64) return; | 26 | @compileError(std.fmt.comptimePrint(fmt, args)); |
| | 27 | } else { |
| | 28 | // Disable printing in tests for simple backends. |
| | 29 | if (builtin.zig_backend == .stage2_spirv64) return; |
| 27 | | 30 | |
| 28 | std.debug.print(fmt, args); | 31 | std.debug.print(fmt, args); |
| | 32 | } |
| 29 | } | 33 | } |
| 30 | | 34 | |
| 31 | /// This function is intended to be used only in tests. It prints diagnostics to stderr | 35 | /// This function is intended to be used only in tests. It prints diagnostics to stderr |