Skip to content

Commit

Permalink
Merge pull request #979 from zig-lang/test-release-small
Browse files Browse the repository at this point in the history
add ReleaseSmall mode in zig tests
  • Loading branch information
andrewrk committed May 3, 2018
2 parents 131c133 + adbb691 commit 7337029
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions test/cases/coroutines.zig
Expand Up @@ -219,8 +219,9 @@ async fn printTrace(p: promise->error!void) void {
std.debug.assert(e == error.Fail);
if (@errorReturnTrace()) |trace| {
assert(trace.index == 1);
} else if (builtin.mode != builtin.Mode.ReleaseFast) {
@panic("expected return trace");
} else switch (builtin.mode) {
builtin.Mode.Debug, builtin.Mode.ReleaseSafe => @panic("expected return trace"),
builtin.Mode.ReleaseFast, builtin.Mode.ReleaseSmall => {},
}
};
}
Expand Down
8 changes: 4 additions & 4 deletions test/tests.zig
Expand Up @@ -152,7 +152,7 @@ pub fn addPkgTests(b: &build.Builder, test_filter: ?[]const u8, root_src: []cons
const step = b.step(b.fmt("test-{}", name), desc);
for (test_targets) |test_target| {
const is_native = (test_target.os == builtin.os and test_target.arch == builtin.arch);
for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {
for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast, Mode.ReleaseSmall}) |mode| {
for ([]bool{false, true}) |link_libc| {
if (link_libc and !is_native) {
// don't assume we have a cross-compiling libc set up
Expand Down Expand Up @@ -451,7 +451,7 @@ pub const CompareOutputContext = struct {
self.step.dependOn(&run_and_cmp_output.step);
},
Special.None => {
for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {
for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast, Mode.ReleaseSmall}) |mode| {
const annotated_case_name = fmt.allocPrint(self.b.allocator, "{} {} ({})",
"compare-output", case.name, @tagName(mode)) catch unreachable;
if (self.test_filter) |filter| {
Expand Down Expand Up @@ -705,7 +705,7 @@ pub const CompileErrorContext = struct {
pub fn addCase(self: &CompileErrorContext, case: &const TestCase) void {
const b = self.b;

for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {
for ([]Mode{Mode.Debug, Mode.ReleaseFast}) |mode| {
const annotated_case_name = fmt.allocPrint(self.b.allocator, "compile-error {} ({})",
case.name, @tagName(mode)) catch unreachable;
if (self.test_filter) |filter| {
Expand Down Expand Up @@ -773,7 +773,7 @@ pub const BuildExamplesContext = struct {
pub fn addAllArgs(self: &BuildExamplesContext, root_src: []const u8, link_libc: bool) void {
const b = self.b;

for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {
for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast, Mode.ReleaseSmall}) |mode| {
const annotated_case_name = fmt.allocPrint(self.b.allocator, "build {} ({})",
root_src, @tagName(mode)) catch unreachable;
if (self.test_filter) |filter| {
Expand Down

0 comments on commit 7337029

Please sign in to comment.