@@ -152,9 +152,11 @@ pub fn link_SDL3(compile_step: *std.Build.Step.Compile) void {
152152pub fn testVersionCheckSDL2 (b : * std.Build , target : std.Build.ResolvedTarget ) * std.Build.Step {
153153 const test_sdl2_version_check = b .addTest (.{
154154 .name = "sdl2-version-check" ,
155- .root_source_file = b .dependency ("zsdl" , .{}).path ("src/sdl2_version_check.zig" ),
156- .target = target ,
157- .optimize = .ReleaseSafe ,
155+ .root_module = b .createModule (.{
156+ .root_source_file = b .dependency ("zsdl" , .{}).path ("src/sdl2_version_check.zig" ),
157+ .target = target ,
158+ .optimize = .ReleaseSafe ,
159+ }),
158160 });
159161
160162 link_SDL2 (test_sdl2_version_check );
@@ -342,7 +344,7 @@ pub const prebuilt_sdl3 = struct {
342344 return & b .addInstallFileWithDir (
343345 sdl3_prebuilt .path ("bin/SDL3.dll" ),
344346 install_dir ,
345- "SDL2 .dll" ,
347+ "SDL3 .dll" ,
346348 ).step ;
347349 }
348350 }
@@ -353,7 +355,7 @@ pub const prebuilt_sdl3 = struct {
353355 return & b .addInstallFileWithDir (
354356 sdl3_prebuilt .path ("lib/libSDL3.so" ),
355357 install_dir ,
356- "libSDL2 .so" ,
358+ "libSDL3 .so" ,
357359 ).step ;
358360 }
359361 }
@@ -383,12 +385,22 @@ fn addTests(
383385 const b = test_step .owner ;
384386 const tests = b .addTest (.{
385387 .name = name ,
386- .root_source_file = b .path (root_src_path ),
387- .target = target ,
388- .optimize = optimize ,
388+ .root_module = b .createModule (.{
389+ .root_source_file = b .path (root_src_path ),
390+ .target = target ,
391+ .optimize = optimize ,
392+ }),
389393 });
390394 b .installArtifact (tests );
391- test_step .dependOn (& b .addRunArtifact (tests ).step );
395+
396+ const run = b .addRunArtifact (tests );
397+ if (target .result .os .tag == .windows ) {
398+ run .setCwd (.{
399+ .cwd_relative = b .getInstallPath (.bin , "" ),
400+ });
401+ }
402+
403+ test_step .dependOn (& run .step );
392404 return tests ;
393405}
394406
0 commit comments