Skip to content

Commit

Permalink
Clean up after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
whatisaphone committed Jul 3, 2024
1 parent 967d9e5 commit 26bf778
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ test "Backyard Baseball 1997 round trip raw" {
const extract_dir = "/tmp/baller-test-baseball-1997-extract";
const build_dir = "/tmp/baller-test-baseball-1997-build";

// best effort cleanup
defer std.fs.cwd().deleteTree(extract_dir) catch {};
defer std.fs.cwd().deleteTree(build_dir) catch {};

try extract.run(allocator, &.{
.input_path = "src/fixtures/baseball1997/BASEBALL.HE0",
.output_path = extract_dir,
Expand Down Expand Up @@ -56,6 +60,10 @@ test "Backyard Baseball 1997 round trip decode/encode" {
const extract_dir = "/tmp/baller-test-baseball-1997-extract";
const build_dir = "/tmp/baller-test-baseball-1997-build";

// best effort cleanup
defer std.fs.cwd().deleteTree(extract_dir) catch {};
defer std.fs.cwd().deleteTree(build_dir) catch {};

try extract.run(allocator, &.{
.input_path = "src/fixtures/baseball1997/BASEBALL.HE0",
.output_path = extract_dir,
Expand Down Expand Up @@ -83,6 +91,10 @@ test "Backyard Baseball 2001 round trip raw" {
const extract_dir = "/tmp/baller-test-baseball-2001-extract";
const build_dir = "/tmp/baller-test-baseball-2001-build";

// best effort cleanup
defer std.fs.cwd().deleteTree(extract_dir) catch {};
defer std.fs.cwd().deleteTree(build_dir) catch {};

try extract.run(allocator, &.{
.input_path = "src/fixtures/baseball2001/baseball 2001.he0",
.output_path = extract_dir,
Expand Down Expand Up @@ -114,6 +126,10 @@ test "Backyard Baseball 2001 round trip decode/encode" {
const extract_dir = "/tmp/baller-test-baseball-2001-extract";
const build_dir = "/tmp/baller-test-baseball-2001-build";

// best effort cleanup
defer std.fs.cwd().deleteTree(extract_dir) catch {};
defer std.fs.cwd().deleteTree(build_dir) catch {};

try extract.run(allocator, &.{
.input_path = "src/fixtures/baseball2001/baseball 2001.he0",
.output_path = extract_dir,
Expand Down

0 comments on commit 26bf778

Please sign in to comment.