build-system: Replace deprecated usages of root_source_file on addTests
parent
49cf8d80a6
commit
d5995ac45c
|
|
@ -108,9 +108,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
|
|
||||||
const test_exe = b.addTest(.{
|
const test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
test_exe.linkLibrary(lib);
|
test_exe.linkLibrary(lib);
|
||||||
const tests_run = b.addRunArtifact(test_exe);
|
const tests_run = b.addRunArtifact(test_exe);
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
|
|
||||||
const test_exe = b.addTest(.{
|
const test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
const tests_run = b.addRunArtifact(test_exe);
|
const tests_run = b.addRunArtifact(test_exe);
|
||||||
const test_step = b.step("test", "Run tests");
|
const test_step = b.step("test", "Run tests");
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
if (target.query.isNative()) {
|
if (target.query.isNative()) {
|
||||||
test_exe = b.addTest(.{
|
test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
const tests_run = b.addRunArtifact(test_exe.?);
|
const tests_run = b.addRunArtifact(test_exe.?);
|
||||||
const test_step = b.step("test", "Run tests");
|
const test_step = b.step("test", "Run tests");
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
if (target.query.isNative()) {
|
if (target.query.isNative()) {
|
||||||
const test_exe = b.addTest(.{
|
const test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
test_exe.linkLibrary(lib);
|
test_exe.linkLibrary(lib);
|
||||||
const tests_run = b.addRunArtifact(test_exe);
|
const tests_run = b.addRunArtifact(test_exe);
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
|
|
||||||
const test_exe = b.addTest(.{
|
const test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
{
|
{
|
||||||
const test_exe = b.addTest(.{
|
const test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
test_exe.linkLibrary(lib);
|
test_exe.linkLibrary(lib);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
{
|
{
|
||||||
const test_exe = b.addTest(.{
|
const test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
if (target.result.os.tag.isDarwin()) {
|
if (target.result.os.tag.isDarwin()) {
|
||||||
try apple_sdk.addPaths(b, test_exe);
|
try apple_sdk.addPaths(b, test_exe);
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
if (target.query.isNative()) {
|
if (target.query.isNative()) {
|
||||||
test_exe = b.addTest(.{
|
test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
const tests_run = b.addRunArtifact(test_exe.?);
|
const tests_run = b.addRunArtifact(test_exe.?);
|
||||||
const test_step = b.step("test", "Run tests");
|
const test_step = b.step("test", "Run tests");
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
if (target.query.isNative()) {
|
if (target.query.isNative()) {
|
||||||
const test_exe = b.addTest(.{
|
const test_exe = b.addTest(.{
|
||||||
.name = "test",
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("main.zig"),
|
.root_source_file = b.path("main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
test_exe.linkLibrary(lib);
|
test_exe.linkLibrary(lib);
|
||||||
const tests_run = b.addRunArtifact(test_exe);
|
const tests_run = b.addRunArtifact(test_exe);
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,12 @@ pub fn build(b: *std.Build) !void {
|
||||||
});
|
});
|
||||||
|
|
||||||
const unit_tests = b.addTest(.{
|
const unit_tests = b.addTest(.{
|
||||||
|
.name = "test",
|
||||||
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("src/main.zig"),
|
.root_source_file = b.path("src/main.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
unit_tests.linkLibC();
|
unit_tests.linkLibC();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue