Skip to content

Commit

Permalink
compilation test
Browse files Browse the repository at this point in the history
This leaks implementation details from the test runner into libstd to
access the to be spawned test block in a new process and parse its
output or return status.

Future TODO: test blocks can observe their own index fn argument.
  • Loading branch information
Jan Philipp Hafer committed Apr 28, 2023
1 parent a9b9694 commit 3b5af53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/std/testing.zig
Original file line number Diff line number Diff line change
Expand Up @@ -917,10 +917,10 @@ test "expectEqualDeep composite type" {
}

// TODO: test blocks can observe their own index fn argument.
// Do not leaks implementation details from the test runner into libstd.
// Do not leak implementation details from the test runner into libstd.
// `test_fns_i` is index into builtin.test_functions set by test runner.
const TestFn_iT = if (!builtin.is_test) u32 else void;
threadlocal var test_fns_i: TestFn_iT = if (!builtin.is_test) 0 else void;
const TestFn_iT = if (builtin.is_test) usize else void;
pub threadlocal var test_fns_i: TestFn_iT = if (builtin.is_test) 0 else {};

/// Send expected panic message to server from test runner, spawns itself as a
/// child process with the test number, tells the server pid and process group
Expand Down

0 comments on commit 3b5af53

Please sign in to comment.