authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-05-18 17:45:06+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-05-18 17:56:17+02:00
log34f84c36082015bb8aacfcfb27cecf44e8e6eb3a
treeeec7aa2f4695e01255714b4583ac67bfe300ed5b
parent2a59ecd7eca7318e9a66d856b04dd9fa45b2d69d

Narrow down behaviour test cases; this removes wasmtime-enabled check in tests


6 files changed, 21 insertions(+), 12 deletions(-)

build.zig+1-1
...@@ -117,7 +117,7 @@ pub fn build(b: *Builder) !void {...@@ -117,7 +117,7 @@ pub fn build(b: *Builder) !void {
117 fmt_step.dependOn(&fmt_build_zig.step);117 fmt_step.dependOn(&fmt_build_zig.step);
118118
119 // TODO for the moment, skip wasm32-wasi until bugs are sorted out.119 // TODO for the moment, skip wasm32-wasi until bugs are sorted out.
120 test_step.dependOn(tests.addPkgTests(b, test_filter, "test/stage1/behavior.zig", "behavior", "Run the behavior tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, false, glibc_multi_dir));120 test_step.dependOn(tests.addPkgTests(b, test_filter, "test/stage1/behavior.zig", "behavior", "Run the behavior tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
121121
122 test_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/std.zig", "std", "Run the standard library tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));122 test_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/std.zig", "std", "Run the standard library tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
123123
test/stage1/behavior.zig+6-2
...@@ -1,9 +1,13 @@...@@ -1,9 +1,13 @@
1const builtin = @import("builtin");
2
1comptime {3comptime {
2 _ = @import("behavior/align.zig");4 _ = @import("behavior/align.zig");
3 _ = @import("behavior/alignof.zig");5 _ = @import("behavior/alignof.zig");
4 _ = @import("behavior/array.zig");6 _ = @import("behavior/array.zig");
5 _ = @import("behavior/asm.zig");7 if (builtin.os.tag != .wasi) {
6 _ = @import("behavior/async_fn.zig");8 _ = @import("behavior/asm.zig");
9 _ = @import("behavior/async_fn.zig");
10 }
7 _ = @import("behavior/atomics.zig");11 _ = @import("behavior/atomics.zig");
8 _ = @import("behavior/await_struct.zig");12 _ = @import("behavior/await_struct.zig");
9 _ = @import("behavior/bit_shifting.zig");13 _ = @import("behavior/bit_shifting.zig");
test/stage1/behavior/align.zig+6
...@@ -133,6 +133,9 @@ fn alignedBig() align(16) i32 {...@@ -133,6 +133,9 @@ fn alignedBig() align(16) i32 {
133}133}
134134
135test "@alignCast functions" {135test "@alignCast functions" {
136 // TODO investigate why this fails when cross-compiled to wasm.
137 if (builtin.os.tag == .wasi) return error.SkipZigTest;
138
136 expect(fnExpectsOnly1(simple4) == 0x19);139 expect(fnExpectsOnly1(simple4) == 0x19);
137}140}
138fn fnExpectsOnly1(ptr: fn () align(1) i32) i32 {141fn fnExpectsOnly1(ptr: fn () align(1) i32) i32 {
...@@ -324,6 +327,9 @@ test "align(@alignOf(T)) T does not force resolution of T" {...@@ -324,6 +327,9 @@ test "align(@alignOf(T)) T does not force resolution of T" {
324}327}
325328
326test "align(N) on functions" {329test "align(N) on functions" {
330 // TODO investigate why this fails when cross-compiled to wasm.
331 if (builtin.os.tag == .wasi) return error.SkipZigTest;
332
327 expect((@ptrToInt(overaligned_fn) & (0x1000 - 1)) == 0);333 expect((@ptrToInt(overaligned_fn) & (0x1000 - 1)) == 0);
328}334}
329fn overaligned_fn() align(0x1000) i32 {335fn overaligned_fn() align(0x1000) i32 {
test/stage1/behavior/shuffle.zig+4
...@@ -1,9 +1,13 @@...@@ -1,9 +1,13 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
2const mem = std.mem;3const mem = std.mem;
3const expect = std.testing.expect;4const expect = std.testing.expect;
4const Vector = std.meta.Vector;5const Vector = std.meta.Vector;
56
6test "@shuffle" {7test "@shuffle" {
8 // TODO investigate why this fails when cross-compiling to wasm.
9 if (builtin.os.tag == .wasi) return error.SkipZigTest;
10
7 const S = struct {11 const S = struct {
8 fn doTheTest() void {12 fn doTheTest() void {
9 var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 };13 var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 };
test/stage1/behavior/vector.zig+4
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
2const mem = std.mem;3const mem = std.mem;
3const math = std.math;4const math = std.math;
4const expect = std.testing.expect;5const expect = std.testing.expect;
...@@ -387,6 +388,9 @@ test "vector bitwise not operator" {...@@ -387,6 +388,9 @@ test "vector bitwise not operator" {
387}388}
388389
389test "vector shift operators" {390test "vector shift operators" {
391 // TODO investigate why this fails when cross-compiled to wasm.
392 if (builtin.os.tag == .wasi) return error.SkipZigTest;
393
390 const S = struct {394 const S = struct {
391 fn doTheTestShift(x: var, y: var) void {395 fn doTheTestShift(x: var, y: var) void {
392 const N = @typeInfo(@TypeOf(x)).Array.len;396 const N = @typeInfo(@TypeOf(x)).Array.len;
test/tests.zig-9
...@@ -483,15 +483,6 @@ pub fn addPkgTests(...@@ -483,15 +483,6 @@ pub fn addPkgTests(
483 if (skip_non_native and !test_target.target.isNative())483 if (skip_non_native and !test_target.target.isNative())
484 continue;484 continue;
485485
486 if (!is_wasmtime_enabled) {
487 if (test_target.target.os_tag) |tag| {
488 if (tag == .wasi) {
489 warn("Skipping {} on wasm32-wasi.\n", .{root_src});
490 continue;
491 }
492 }
493 }
494
495 if (skip_libc and test_target.link_libc)486 if (skip_libc and test_target.link_libc)
496 continue;487 continue;
497488