Skip to content

"zig init-exe && zig build test" does not run tests #15059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danielchasehooper opened this issue Mar 23, 2023 · 4 comments
Closed

"zig init-exe && zig build test" does not run tests #15059

danielchasehooper opened this issue Mar 23, 2023 · 4 comments
Labels
bug Observed behavior contradicts documented or intended behavior regression It worked in a previous version of Zig, but stopped working.
Milestone

Comments

@danielchasehooper
Copy link
Contributor

Zig Version

0.11.0-dev.2245+dc6b05408

Steps to Reproduce and Observed Behavior

zig init-exe
sed -i 's/append(42)/append(48)/g' src/main.zig
zig build test

no tests fail. They don't seem to run at all.

Expected Behavior

test should run and fail

@danielchasehooper danielchasehooper added the bug Observed behavior contradicts documented or intended behavior label Mar 23, 2023
@scheibo
Copy link
Contributor

scheibo commented Mar 23, 2023

#15009

@chrboesch
Copy link
Contributor

Same behavior with zig version 0.11.0-dev.2247+38ee46dda

@danielchasehooper danielchasehooper changed the title zig init-exe/zig build test does not run tests "zig init-exe && zig build test" does not run tests Mar 24, 2023
@perillo
Copy link
Contributor

perillo commented Mar 29, 2023

The fix for this issue is blocked (probably) by #15104.

perillo added a commit to perillo/zig that referenced this issue Apr 6, 2023
Currently, these tests work because of issue ziglang#15059, but ziglang#15059 requires
issue ziglang#15104 to be fixed, and it is taking a lot of time.

Temporarily disable the init-lib and init-exe tests in
`test/tests.addCliTests`.
@andrewrk andrewrk added the regression It worked in a previous version of Zig, but stopped working. label Apr 10, 2023
@andrewrk andrewrk added this to the 0.11.0 milestone Apr 10, 2023
@andrewrk
Copy link
Member

Not sure why that ever didn't work, but it works now:

andy@ark ~/t/abc> rm -rf ./*
andy@ark ~/t/abc> zig init-exe
info: Created build.zig
info: Created src/main.zig
info: Next, try `zig build --help` or `zig build run`
andy@ark ~/t/abc> zig build test
andy@ark ~/t/abc> vim src/main.zig 
andy@ark ~/t/abc> zig build test
run test: error: 'test.simple test' failed: expected 42, found 48
/home/andy/Downloads/zig/lib/std/testing.zig:84:17: 0x20a3d9 in expectEqual__anon_2251 (test)
                return error.TestExpectedEqual;
                ^
/home/andy/tmp/abc/src/main.zig:23:5: 0x20a56d in test.simple test (test)
    try std.testing.expectEqual(@as(i32, 42), list.pop());
    ^
run test: error: while executing test 'test.simple test', the following test command failed:
/home/andy/tmp/abc/zig-cache/o/afbc3888946645889e8cadd7bc24c974/test --listen=- 
Build Summary: 1/3 steps succeeded; 1 failed; 0/1 tests passed; 1 failed (disable with --summary none)
test transitive failure
└─ run test 0/1 passed, 1 failed
error: the following build command failed with exit code 1:
/home/andy/tmp/abc/zig-cache/o/13420f61f0c24cff96441418b608d9be/build /home/andy/Downloads/zig/build-release/stage3/bin/zig /home/andy/tmp/abc /home/andy/tmp/abc/zig-cache /home/andy/.cache/zig test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior regression It worked in a previous version of Zig, but stopped working.
Projects
None yet
Development

No branches or pull requests

5 participants