Skip to content

Commit b7be082

Browse files
committedJul 18, 2018
-Dskip-release now also skips build example tests
·
0.15.10.3.0
1 parent 843529d commit b7be082

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed
 

‎build.zig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub fn build(b: *Builder) !void {
9292
test_step.dependOn(tests.addPkgTests(b, test_filter, "std/special/compiler_rt/index.zig", "compiler-rt", "Run the compiler_rt tests", modes));
9393

9494
test_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes));
95-
test_step.dependOn(tests.addBuildExampleTests(b, test_filter));
95+
test_step.dependOn(tests.addBuildExampleTests(b, test_filter, modes));
9696
test_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes));
9797
test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes));
9898
test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes));

‎test/tests.zig‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ pub fn addCompileErrorTests(b: *build.Builder, test_filter: ?[]const u8, modes:
8989
return cases.step;
9090
}
9191

92-
pub fn addBuildExampleTests(b: *build.Builder, test_filter: ?[]const u8) *build.Step {
92+
pub fn addBuildExampleTests(b: *build.Builder, test_filter: ?[]const u8, modes: []const Mode) *build.Step {
9393
const cases = b.allocator.create(BuildExamplesContext{
9494
.b = b,
9595
.step = b.step("test-build-examples", "Build the examples"),
9696
.test_index = 0,
9797
.test_filter = test_filter,
98+
.modes = modes,
9899
}) catch unreachable;
99100

100101
build_examples.addCases(cases);
@@ -697,6 +698,7 @@ pub const BuildExamplesContext = struct {
697698
step: *build.Step,
698699
test_index: usize,
699700
test_filter: ?[]const u8,
701+
modes: []const Mode,
700702

701703
pub fn addC(self: *BuildExamplesContext, root_src: []const u8) void {
702704
self.addAllArgs(root_src, true);
@@ -739,12 +741,7 @@ pub const BuildExamplesContext = struct {
739741
pub fn addAllArgs(self: *BuildExamplesContext, root_src: []const u8, link_libc: bool) void {
740742
const b = self.b;
741743

742-
for ([]Mode{
743-
Mode.Debug,
744-
Mode.ReleaseSafe,
745-
Mode.ReleaseFast,
746-
Mode.ReleaseSmall,
747-
}) |mode| {
744+
for (self.modes) |mode| {
748745
const annotated_case_name = fmt.allocPrint(self.b.allocator, "build {} ({})", root_src, @tagName(mode)) catch unreachable;
749746
if (self.test_filter) |filter| {
750747
if (mem.indexOf(u8, annotated_case_name, filter) == null) continue;

0 commit comments

Comments
 (0)
Please sign in to comment.