authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-05-03 11:47:22-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2018-05-03 11:47:22-04:00
log7337029ce1a73f258ea42a965b380bb3b6fc85dd
tree3ea94c3fe004a3d0e1ae4bf8cd2c58a53c9d489a
parent131c133bb74eab2012158c8ecfaa78944db197c7
parentadbb691f46083504dd0134543d979b035d7e00d6
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #979 from zig-lang/test-release-small

add ReleaseSmall mode in zig tests

2 files changed, 7 insertions(+), 6 deletions(-)

test/cases/coroutines.zig+3-2
...@@ -219,8 +219,9 @@ async fn printTrace(p: promise->error!void) void {...@@ -219,8 +219,9 @@ async fn printTrace(p: promise->error!void) void {
219 std.debug.assert(e == error.Fail);219 std.debug.assert(e == error.Fail);
220 if (@errorReturnTrace()) |trace| {220 if (@errorReturnTrace()) |trace| {
221 assert(trace.index == 1);221 assert(trace.index == 1);
222 } else if (builtin.mode != builtin.Mode.ReleaseFast) {222 } else switch (builtin.mode) {
223 @panic("expected return trace");223 builtin.Mode.Debug, builtin.Mode.ReleaseSafe => @panic("expected return trace"),
224 builtin.Mode.ReleaseFast, builtin.Mode.ReleaseSmall => {},
224 }225 }
225 };226 };
226}227}
test/tests.zig+4-4
...@@ -152,7 +152,7 @@ pub fn addPkgTests(b: &build.Builder, test_filter: ?[]const u8, root_src: []cons...@@ -152,7 +152,7 @@ pub fn addPkgTests(b: &build.Builder, test_filter: ?[]const u8, root_src: []cons
152 const step = b.step(b.fmt("test-{}", name), desc);152 const step = b.step(b.fmt("test-{}", name), desc);
153 for (test_targets) |test_target| {153 for (test_targets) |test_target| {
154 const is_native = (test_target.os == builtin.os and test_target.arch == builtin.arch);154 const is_native = (test_target.os == builtin.os and test_target.arch == builtin.arch);
155 for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {155 for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast, Mode.ReleaseSmall}) |mode| {
156 for ([]bool{false, true}) |link_libc| {156 for ([]bool{false, true}) |link_libc| {
157 if (link_libc and !is_native) {157 if (link_libc and !is_native) {
158 // don't assume we have a cross-compiling libc set up158 // don't assume we have a cross-compiling libc set up
...@@ -451,7 +451,7 @@ pub const CompareOutputContext = struct {...@@ -451,7 +451,7 @@ pub const CompareOutputContext = struct {
451 self.step.dependOn(&run_and_cmp_output.step);451 self.step.dependOn(&run_and_cmp_output.step);
452 },452 },
453 Special.None => {453 Special.None => {
454 for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {454 for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast, Mode.ReleaseSmall}) |mode| {
455 const annotated_case_name = fmt.allocPrint(self.b.allocator, "{} {} ({})",455 const annotated_case_name = fmt.allocPrint(self.b.allocator, "{} {} ({})",
456 "compare-output", case.name, @tagName(mode)) catch unreachable;456 "compare-output", case.name, @tagName(mode)) catch unreachable;
457 if (self.test_filter) |filter| {457 if (self.test_filter) |filter| {
...@@ -705,7 +705,7 @@ pub const CompileErrorContext = struct {...@@ -705,7 +705,7 @@ pub const CompileErrorContext = struct {
705 pub fn addCase(self: &CompileErrorContext, case: &const TestCase) void {705 pub fn addCase(self: &CompileErrorContext, case: &const TestCase) void {
706 const b = self.b;706 const b = self.b;
707707
708 for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {708 for ([]Mode{Mode.Debug, Mode.ReleaseFast}) |mode| {
709 const annotated_case_name = fmt.allocPrint(self.b.allocator, "compile-error {} ({})",709 const annotated_case_name = fmt.allocPrint(self.b.allocator, "compile-error {} ({})",
710 case.name, @tagName(mode)) catch unreachable;710 case.name, @tagName(mode)) catch unreachable;
711 if (self.test_filter) |filter| {711 if (self.test_filter) |filter| {
...@@ -773,7 +773,7 @@ pub const BuildExamplesContext = struct {...@@ -773,7 +773,7 @@ pub const BuildExamplesContext = struct {
773 pub fn addAllArgs(self: &BuildExamplesContext, root_src: []const u8, link_libc: bool) void {773 pub fn addAllArgs(self: &BuildExamplesContext, root_src: []const u8, link_libc: bool) void {
774 const b = self.b;774 const b = self.b;
775775
776 for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {776 for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast, Mode.ReleaseSmall}) |mode| {
777 const annotated_case_name = fmt.allocPrint(self.b.allocator, "build {} ({})",777 const annotated_case_name = fmt.allocPrint(self.b.allocator, "build {} ({})",
778 root_src, @tagName(mode)) catch unreachable;778 root_src, @tagName(mode)) catch unreachable;
779 if (self.test_filter) |filter| {779 if (self.test_filter) |filter| {