11const std = @import ("std" );
2- const builtin = @import ("builtin" );
32const assert = std .debug .assert ;
3+ const builtin = @import ("builtin" );
44
5- const zig_version = std.SemanticVersion { . major = 0 , . minor = 14 , . patch = 1 } ;
5+ const AsyncKind = @import ( "src/aio/lib.zig" ). AsyncKind ;
66
7+ const zig_version = std.SemanticVersion { .major = 0 , .minor = 15 , .patch = 1 };
78comptime {
89 // Compare versions while allowing different pre/patch metadata.
910 const zig_version_eq = zig_version .major == builtin .zig_version .major and
1011 zig_version .minor == builtin .zig_version .minor and
1112 zig_version .patch == builtin .zig_version .patch ;
1213 if (! zig_version_eq ) {
1314 @compileError (std .fmt .comptimePrint (
14- "unsupported zig version: expected {}, found {}" ,
15+ "unsupported zig version: expected {f }, found {f }" ,
1516 .{ zig_version , builtin .zig_version },
1617 ));
1718 }
@@ -20,7 +21,6 @@ comptime {
2021const Example = enum {
2122 none ,
2223 all ,
23-
2424 basic ,
2525 cat ,
2626 channel ,
@@ -49,8 +49,6 @@ const Example = enum {
4949 return ex_string ;
5050 }
5151};
52- const AsyncKind = @import ("src/aio/lib.zig" ).AsyncKind ;
53-
5452pub fn build (b : * std.Build ) void {
5553
5654 // Top-level steps you can invoke on the command line.
@@ -114,7 +112,7 @@ pub fn build(b: *std.Build) void {
114112 });
115113
116114 // build and run e2e test
117- // usage: zig build test_e2e -- Dasync=[async_backend] -- [u64 num]
115+ // usage: zig build test_e2e -Dasync=[async_backend] -- [u64 num]
118116 build_test_e2e (b , .{
119117 .test_e2e = build_steps .test_e2e ,
120118 }, .{
@@ -253,6 +251,8 @@ fn build_example_exe(
253251 const example_exe = b .addExecutable (.{
254252 .name = options .example .toString (),
255253 .root_module = example_mod ,
254+ // without llvm leads to error: undefined symbol: tardy_swap_frame
255+ .use_llvm = true ,
256256 });
257257
258258 const install_artifact = b .addInstallArtifact (example_exe , .{});
@@ -269,6 +269,11 @@ fn build_example_exe(
269269 const run_artifact = b .addRunArtifact (example_exe );
270270 run_artifact .step .dependOn (& install_artifact .step );
271271
272+ // pass args to examples (.ie cat, rmdir, shove, stat)
273+ if (b .args ) | args | {
274+ run_artifact .addArgs (args );
275+ }
276+
272277 steps .run .dependOn (& install_artifact .step );
273278 steps .run .dependOn (& run_artifact .step );
274279}
@@ -317,9 +322,11 @@ fn build_test(
317322 // usage: zig build test_unit
318323 const unit_tests = b .addTest (.{
319324 .name = "general unit tests" ,
320- .root_source_file = b .path ("./src/tests.zig" ),
321- .optimize = options .optimize ,
322- .target = options .target ,
325+ .root_module = b .createModule (.{
326+ .root_source_file = b .path ("./src/tests.zig" ),
327+ .optimize = options .optimize ,
328+ .target = options .target ,
329+ }),
323330 });
324331
325332 const run_unit_tests = b .addRunArtifact (unit_tests );
@@ -355,6 +362,7 @@ fn build_test_e2e(
355362 .root_source_file = b .path ("test/e2e/main.zig" ),
356363 .target = options .target ,
357364 .optimize = options .optimize ,
365+ .strip = false ,
358366 });
359367
360368 e2e_mod .addImport ("tardy" , options .tardy_mod );
@@ -374,7 +382,8 @@ fn build_test_e2e(
374382 const exe = b .addExecutable (.{
375383 .name = "e2e" ,
376384 .root_module = e2e_mod ,
377- .strip = false ,
385+ // without llvm leads to error: undefined symbol: tardy_swap_frame
386+ .use_llvm = true ,
378387 });
379388
380389 // build/install e2e test
0 commit comments