Comments (2)
test "teardownonce" {...}
It would be highly unintuitive for me if Zig changed the behavior of tests based on the string literal used to name the test case.
If such a feature were introduced, it should imo be specially marked in the source code in some other way.
I also don't think the benefit of the per-test setup
and teardown
is worth this special-casing.
You can already declare them as normal functions and start your test blocks with setup(); defer teardown();
for the same effect.
The proposal also isn't concrete enough about which scope these special constructs should apply to.
Currently zig test
collects all test declarations found, starting with analysis of the root source file, and may include the entire source tree.
I doubt you need/want the same setup
and teardown
procedure for every test in your source code. This work is overhead for tests that don't need it.
Also note zig test
CLI option --test-runner
can already be used to specify a custom (modified) test runner.
You could use that to implement the setuponce
and teardownonce
behavior in userland in status-quo.
my second day in Zig ...
Feel free to discuss and share your experiences in one of the Community spaces.
This issue tracker tries to stay focused on technical discussion of bugs/deficiencies in Zig and core Zig toolchain development.
"X would be nice" feature requests are (in my experience) generally considered off-topic,
unless you can provide a use case that would directly benefit Zig toolchain development itself.
from zig.
Feel free to discuss and share your experiences in one of the Community spaces.
I added r/Zig to Community
Thanks you
from zig.
Related Issues (20)
- Some question regarding MSVC abi static library linking HOT 2
- Switch prongs should be provided result type based on value being switched on HOT 2
- Invalid `try` operand type deduction
- LLVM abort compiling call to function instantiating empty error set with `undefined` in `comptime` block HOT 3
- Segmentation fault compiling call to function returning `undefined` element of empty error set in `comptime` block
- Segmentation fault compiling `@splat` for vector type with one possible value HOT 2
- Reached unreachable compiling `@ptrCast` from `allowzero` pointer
- `@divExact` provides no safety guarantee for runtime-known float operands HOT 1
- `@ptrCast` provides no safety guarantee for casts to `[*]T` from`?[]T` at runtime HOT 1
- Shared state of case block produces unexpected usage of runtime safety mechanism
- Segmentation fault compiling store to runtime memory at compile time HOT 5
- unsure how to proceed when getting "Bus error at address 0x0" HOT 11
- `dependsOnSystemLibrary` no iterate `*std.Build.Module` from `*Step.Compile`
- Possible bitshifting footgun HOT 4
- dir.statFile on windows named pipe sometimes produces unexpectedStatus
- package manager can't download from bitbucket - Content-Type application/x-tar-gz HOT 3
- Can't build a working program for MIPS32 mips-linux-musl target triple with `zig cc` HOT 3
- Zig fetch: Unable to discover remote git server capabilities
- `unreachable` hit using `try @errorCast` on error set in function with IES HOT 4
- `try @errorCast(foo)` doesnt work if it has no result type HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zig.