You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'with test' links for _main instead of running test_* functions #11
A file that contains only test_* functions does not run under with test. Instead, the linker fails looking for _main.
fn test_addition:
assert(1 + 1 == 2)
Undefined symbols for architecture arm64:
"_main", referenced from:
<initial-undefines>
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: test build failed
Expected behavior
with test should discover and run test_* functions without requiring an explicit main, consistent with the language docs.
Repro
cat >/tmp/with_test_requires_main.w <<'END_SOURCE'fn test_addition: assert(1 + 1 == 2)END_SOURCE
with test /tmp/with_test_requires_main.w
Impact
This forced the Crux bootstrap repo to wrap every test file in a manual main, which defeats the documented test workflow and adds boilerplate to every test source.
Activity
Run discovered test_* functions in 'with test'