ChanServ changed the topic of #zig to: zig programming language | | be excellent to each other | channel logs:
hspak has quit [Ping timeout: 252 seconds]
xentec has quit [Quit: memento mori]
xentec has joined #zig
brzg has joined #zig
hspak has joined #zig
bitmapper has quit [Quit: Connection closed for inactivity]
earnestly has quit [Ping timeout: 265 seconds]
osa1_ has joined #zig
osa1 has quit [Ping timeout: 265 seconds]
<andrewrk> nice work mikdusan
<andrewrk> looks like thanks to your work we'll have aarch64-macos tarballs on the download page shortly
jumpnbrownweasel has joined #zig
osa1_ has quit [Ping timeout: 268 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
edr has quit [Remote host closed the connection]
edr has joined #zig
klltkr has quit [Remote host closed the connection]
brzg has quit [Quit: leaving]
mikdusan has quit [Quit: WeeChat 3.0.1]
jumpnbrownweasel has quit [Quit: Connection closed]
mikdusan has joined #zig
knebulae has quit [Read error: Connection reset by peer]
osa1 has joined #zig
cole-h has quit [Ping timeout: 265 seconds]
xackus_ has joined #zig
retropikzel has quit [Quit: Leaving]
ur5us has joined #zig
earnestly has joined #zig
daex has quit [Ping timeout: 252 seconds]
daex has joined #zig
ur5us has quit [Ping timeout: 258 seconds]
xackus_ has quit [Read error: Connection reset by peer]
xackus has joined #zig
retropikzel has joined #zig
superdump has quit [Quit: Idle for 30+ days]
knebulae has joined #zig
SimonNa has quit [Remote host closed the connection]
retropikzel has quit [Ping timeout: 250 seconds]
SimonNa has joined #zig
pretty_dumm_guy has joined #zig
dyeplexer has joined #zig
retropikzel has joined #zig
WilhelmVonWeiner has joined #zig
waleee-cl has joined #zig
LewisGaul has joined #zig
<LewisGaul> I'm trying to set the `log_level` in a test module, but when invoking `zig test foo.zig` `@import("root")` doesn't seem to correspond to the module `foo.zig` ?
<LewisGaul> Or maybe there's something else I'm missing about why log output isn't shown during 'zig test'
<fengb> For zig test, the root corresponds to test_runner.zig
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
earnestly has quit [Ping timeout: 265 seconds]
<LewisGaul> ok makes sense, so is there no way to set the log level?
<LewisGaul> Also, is there any way to do this? `if (isError(result)) ...` where result is an error union e.g. `result: anyerror!u8`
<dutchie> `if (result) |_| {} |err| { ... }`
<dutchie> oops, i mean `else |err|`
<dutchie> or you can use `_ = result catch { ... }`
<LewisGaul> Yeah so I tried that but this is invalid syntax: `if (p.parse(input_nt)) |_| testing.expect(false) else |_| {};`
<LewisGaul> it's also a lot of syntax for things I don't actual care about (both payloads and the entire else block)
<LewisGaul> I want to do something *on success* (fail) but just continue on failure
<LewisGaul> so I kind of want the opposite of the catch block
<LewisGaul> I wanted to use `testing.expectError()` but it seems to only work with a specific error rather than being able to catch an error from a set of errors
<xackus> I think I will make a PR to add isError to std.meta
<LewisGaul> that would be cool - any advice/ideas on how I can do it for now?
<xackus> your if statement seems correct
<xackus> maybe you have an error in a different spot
<LewisGaul> I think the problem is that the `{}` after the else is interpreted as a block rather than as a 'void' value?
<Nypsie> In your if statement you're discarding the error, which is not allowed.
<LewisGaul> it works if I replace `{}` with `testing.expect(true)`
<Nypsie> Also the ';' after the block is invalid
<xackus> discarding is allowed
<xackus> this works: if (std.math.absInt(@as(i8, 3))) |_| {} else |_| {}
<LewisGaul> ahh it's the semicolon because it was intended to act as a block, got it :)
<xackus> but the semicolon is invalid indeed
<LewisGaul> I get confused by the fact blocks don't have semicolons but things like struct definitions do
earnestly has joined #zig
<Nypsie> xackus, ah my bad. I guess the else case itself is required but you're allowed to discard the value.
warbucks has joined #zig
warbucks has quit [Quit: -a- IRC for Android 2.1.59]
sord937 has joined #zig
fritchie has joined #zig
fritchie has left #zig [#zig]
SebastianM has joined #zig
mschwaig has quit [Quit: WeeChat 3.0]
mschwaig has joined #zig
SebastianM has quit [Quit: -a- Bye Bye]
notzmv has quit [Read error: Connection reset by peer]
wilsonk has quit [Quit: Leaving]
klltkr has joined #zig
Guest35219 has joined #zig
wilsonk has joined #zig
Guest35219 has quit [Remote host closed the connection]
notzmv- has joined #zig
notzmv- is now known as notzmv
mschwaig has quit [Quit: WeeChat 3.0]
mschwaig has joined #zig
mschwaig has quit [Client Quit]
mschwaig has joined #zig
paulgrmn_ has joined #zig
cole-h has joined #zig
Akuli has joined #zig
paulgrmn_ has quit [Ping timeout: 268 seconds]
Akuli_ has joined #zig
xackus has quit [Ping timeout: 268 seconds]
Akuli_ has quit [Remote host closed the connection]
sord937 has quit [Quit: sord937]
pretty_dumm_guy has joined #zig
<LewisGaul> Just wondering, is it possible to drop in an alternative implementation of `test_runner.zig` ?
<txdv> What does the code say?
<LewisGaul> well I couldn't see any comments about it in that module itself, or in the cpp file that mentions it
<txdv> the error handling is really handling all the cases
<andrewrk> mikdusan, aarch64-macos tarballs are up on the download page
<g-w1> LewisGaul: what is the use case for dropping it in?
<mikdusan> andrewrk: the .toml order. I was thinking that might have something to do with it
<mikdusan> nice. thanks
cole-h has quit [Ping timeout: 260 seconds]
<LewisGaul> g-w1 I'm kind of just wondering what's possible with zig tests:)  I have a set of tests that are filesystem-based, as in iterate over a directory to find subdirs that correspond to testcases. I'm having to do that in a single "test" block, wondering if I should just be using a custom test runner with its own 'main' or something instead, and not
<LewisGaul> sure how trivially it would integrate with the build system
<g-w1> well test cases are provided to the test runner, so it can't find new test cases
<LewisGaul> also thinking maybe I'd want to override `test_runner.log()` since that gets picked up as the `root.log()` implementation
<LewisGaul> I guess this is more in the direction of integration tests than unit tests (although I can still imagine cases this could apply to UT)
<LewisGaul> Also musing on the idea of having test orchestrators written in user-space in the future with features such as writing logs to file, continue if a test fails and report all results at the end, select and filter tests by module/test description, ... Wondering what that would look like/if there's anything that would need to be added for stuff like
<LewisGaul> this to be possible
<g-w1> do you want the custom test runner to find the tests or just run them? the latter is very doable
<LewisGaul> oh sorry I wasn't clear - the subdirs contain JSON files which correspond to testcases, as opposed to the subdirs containing test zig code
<LewisGaul> so testcases are effectively dynamically generated I guess
<LewisGaul> I have them all being run from a single "test" block because that's the only way it can work, but there's no way to tell zig it actually corresponds to multiple testcases that I'm aware of, so I get "All 1 tests passed" at the end. Not really a big deal, but just feels like a setup the standard zig test isn't built for?
<g-w1> setup you own runner like src/test.zig does that uses std.Progress
<LewisGaul> a-ha - "// TODO: find a way to treat cases as individual tests (shouldn't show "1 test passed" if there are 200 cases)" :)
<LewisGaul> yeah seems similar to what I've done
xackus has joined #zig
dyeplexer has quit [Remote host closed the connection]
m4r35n357 has quit [Quit: Ex-Chat]
paulgrmn_ has joined #zig
paulgrmn_ has quit [Ping timeout: 240 seconds]
bzoop has joined #zig
<bzoop> random question - is specifying any target (with -Dtarget) mutually exclusive with the env var ZIG_SYSTEM_LINKER_HACK from telling zig using the native lld linker (for macos-aarch64) -- even if the target ends up being the same (native-macos, for example)?
<g-w1> i *think* the system linker hack is only needed for targeting macos from macos, not 100% positive though. also, i dont think lld is native, ld is
<bzoop> i was seeing this behavior when fiddling around (trying to link system libcurl) -
<g-w1> i would file a bug in this case
<bzoop> oh snap. i just remembered --verbose-link, and sure enough... if i specify a target "zig ld" gets used. otherwise system ld.
<g-w1> might be a bug in the logic in src/link/MachO.zig
<bzoop> -Dtarget=native still uses ld, but -Dtarget=native-macos used zig ld
<bzoop> k. tnx @g-w1! i'll file a bug on the off chance it wasn't expected behavior.
<bzoop> and line 638 sets the bool for the if block
lemur has joined #zig
<bzoop> so perhaps self.base.options.is_native_os isn't quite a match somehow :thinking:
<g-w1> maybe macos is baseline, but you have some different version?
<lemur> What's the best-supported IDE/Editor for zig? I'm kind of spoilt on JetBrains, but the plugin seems to be quite outdated....
<bzoop> the native triple is pretty weird looking: "aarch64-macos.11.2.3...11.2.3-gnu"
<bzoop> but the "zig targets" .native.os is "macos"
<bzoop> *is listed as
<xackus> any editor that supports language server protocol, then you can use
<xackus> sometimes it crashes, but it's great
<g-w1> most editors restart crashing lsp servers anyways :P
<lemur> xackus: ok, great! Thanks.
<xackus> vscode stops after 5 crashes
<bzoop> @g-w1 I filed an issue, in case you were interested in following:
<bzoop> and thanks for your help!
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Akuli has quit [Quit: Leaving]
bzoop_ has joined #zig
bzoop has quit [Quit: Connection closed]
bzoop_ is now known as bzoop
lemur has quit [Quit: Konversation terminated!]
bzoop is now known as bzoop_
bzoop_ is now known as bzoop
bzoop has left #zig [#zig]
ur5us has joined #zig
plumm has quit [Quit: Textual IRC Client:]
cole-h has joined #zig