| ... | ... | @@ -391,8 +391,10 @@ pub const TestContext = struct { |
| 391 | 391 | prg_node.activate(); |
| 392 | 392 | defer prg_node.end(); |
| 393 | 393 | |
| 394 | | // So that we can see which test case failed when the leak checker goes off. |
| 395 | | progress.refresh(); |
| 394 | // So that we can see which test case failed when the leak checker goes off, |
| 395 | // or there's an internal error |
| 396 | progress.initial_delay_ns = 0; |
| 397 | progress.refresh_rate_ns = 0; |
| 396 | 398 | |
| 397 | 399 | const info = try std.zig.system.NativeTargetInfo.detect(std.testing.allocator, case.target); |
| 398 | 400 | try self.runOneCase(std.testing.allocator, &prg_node, case, info.target); |
| ... | ... | @@ -408,10 +410,6 @@ pub const TestContext = struct { |
| 408 | 410 | const root_pkg = try Package.create(allocator, tmp.dir, ".", tmp_src_path); |
| 409 | 411 | defer root_pkg.destroy(); |
| 410 | 412 | |
| 411 | | var prg_node = root_node.start(case.name, case.updates.items.len); |
| 412 | | prg_node.activate(); |
| 413 | | defer prg_node.end(); |
| 414 | | |
| 415 | 413 | const bin_name = try std.zig.binNameAlloc(allocator, "test_case", target, case.output_mode, null); |
| 416 | 414 | defer allocator.free(bin_name); |
| 417 | 415 | |
| ... | ... | @@ -434,7 +432,7 @@ pub const TestContext = struct { |
| 434 | 432 | defer module.deinit(); |
| 435 | 433 | |
| 436 | 434 | for (case.updates.items) |update, update_index| { |
| 437 | | var update_node = prg_node.start("update", 4); |
| 435 | var update_node = root_node.start("update", 3); |
| 438 | 436 | update_node.activate(); |
| 439 | 437 | defer update_node.end(); |
| 440 | 438 | |
| ... | ... | @@ -451,6 +449,7 @@ pub const TestContext = struct { |
| 451 | 449 | |
| 452 | 450 | switch (update.case) { |
| 453 | 451 | .Transformation => |expected_output| { |
| 452 | update_node.estimated_total_items = 5; |
| 454 | 453 | var emit_node = update_node.start("emit", null); |
| 455 | 454 | emit_node.activate(); |
| 456 | 455 | var new_zir_module = try zir.emit(allocator, module); |
| ... | ... | @@ -464,9 +463,15 @@ pub const TestContext = struct { |
| 464 | 463 | try new_zir_module.writeToStream(allocator, out_zir.outStream()); |
| 465 | 464 | write_node.end(); |
| 466 | 465 | |
| 466 | var test_node = update_node.start("assert", null); |
| 467 | test_node.activate(); |
| 467 | 468 | std.testing.expectEqualSlices(u8, expected_output, out_zir.items); |
| 469 | test_node.end(); |
| 468 | 470 | }, |
| 469 | 471 | .Error => |e| { |
| 472 | var test_node = update_node.start("assert", null); |
| 473 | test_node.activate(); |
| 474 | defer test_node.end(); |
| 470 | 475 | var handled_errors = try allocator.alloc(bool, e.len); |
| 471 | 476 | defer allocator.free(handled_errors); |
| 472 | 477 | for (handled_errors) |*h| { |
| ... | ... | @@ -495,6 +500,7 @@ pub const TestContext = struct { |
| 495 | 500 | } |
| 496 | 501 | }, |
| 497 | 502 | .Execution => |expected_stdout| { |
| 503 | update_node.estimated_total_items = 4; |
| 498 | 504 | var exec_result = x: { |
| 499 | 505 | var exec_node = update_node.start("execute", null); |
| 500 | 506 | exec_node.activate(); |
| ... | ... | @@ -511,6 +517,10 @@ pub const TestContext = struct { |
| 511 | 517 | .cwd_dir = tmp.dir, |
| 512 | 518 | }); |
| 513 | 519 | }; |
| 520 | var test_node = update_node.start("test", null); |
| 521 | test_node.activate(); |
| 522 | defer test_node.end(); |
| 523 | |
| 514 | 524 | defer allocator.free(exec_result.stdout); |
| 515 | 525 | defer allocator.free(exec_result.stderr); |
| 516 | 526 | switch (exec_result.term) { |