aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-05-18 17:45:06 +0200
committerJakub Konka <kubkon@jakubkonka.com>2020-05-18 17:56:17 +0200
commit34f84c36082015bb8aacfcfb27cecf44e8e6eb3a (patch)
treeeec7aa2f4695e01255714b4583ac67bfe300ed5b /test
parent2a59ecd7eca7318e9a66d856b04dd9fa45b2d69d (diff)
downloadzig-34f84c36082015bb8aacfcfb27cecf44e8e6eb3a.tar.gz
zig-34f84c36082015bb8aacfcfb27cecf44e8e6eb3a.zip
Narrow down behaviour test cases; this removes wasmtime-enabled check in tests
Diffstat (limited to 'test')
-rw-r--r--test/stage1/behavior.zig8
-rw-r--r--test/stage1/behavior/align.zig6
-rw-r--r--test/stage1/behavior/shuffle.zig4
-rw-r--r--test/stage1/behavior/vector.zig4
-rw-r--r--test/tests.zig9
5 files changed, 20 insertions, 11 deletions
diff --git a/test/stage1/behavior.zig b/test/stage1/behavior.zig
index 61b0c1aa56..cc498df959 100644
--- a/test/stage1/behavior.zig
+++ b/test/stage1/behavior.zig
@@ -1,9 +1,13 @@
+const builtin = @import("builtin");
+
comptime {
_ = @import("behavior/align.zig");
_ = @import("behavior/alignof.zig");
_ = @import("behavior/array.zig");
- _ = @import("behavior/asm.zig");
- _ = @import("behavior/async_fn.zig");
+ if (builtin.os.tag != .wasi) {
+ _ = @import("behavior/asm.zig");
+ _ = @import("behavior/async_fn.zig");
+ }
_ = @import("behavior/atomics.zig");
_ = @import("behavior/await_struct.zig");
_ = @import("behavior/bit_shifting.zig");
diff --git a/test/stage1/behavior/align.zig b/test/stage1/behavior/align.zig
index e9b7e0f1d6..2d0e8f0982 100644
--- a/test/stage1/behavior/align.zig
+++ b/test/stage1/behavior/align.zig
@@ -133,6 +133,9 @@ fn alignedBig() align(16) i32 {
}
test "@alignCast functions" {
+ // TODO investigate why this fails when cross-compiled to wasm.
+ if (builtin.os.tag == .wasi) return error.SkipZigTest;
+
expect(fnExpectsOnly1(simple4) == 0x19);
}
fn fnExpectsOnly1(ptr: fn () align(1) i32) i32 {
@@ -324,6 +327,9 @@ test "align(@alignOf(T)) T does not force resolution of T" {
}
test "align(N) on functions" {
+ // TODO investigate why this fails when cross-compiled to wasm.
+ if (builtin.os.tag == .wasi) return error.SkipZigTest;
+
expect((@ptrToInt(overaligned_fn) & (0x1000 - 1)) == 0);
}
fn overaligned_fn() align(0x1000) i32 {
diff --git a/test/stage1/behavior/shuffle.zig b/test/stage1/behavior/shuffle.zig
index 4281d645e5..3b6412b386 100644
--- a/test/stage1/behavior/shuffle.zig
+++ b/test/stage1/behavior/shuffle.zig
@@ -1,9 +1,13 @@
const std = @import("std");
+const builtin = @import("builtin");
const mem = std.mem;
const expect = std.testing.expect;
const Vector = std.meta.Vector;
test "@shuffle" {
+ // TODO investigate why this fails when cross-compiling to wasm.
+ if (builtin.os.tag == .wasi) return error.SkipZigTest;
+
const S = struct {
fn doTheTest() void {
var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 };
diff --git a/test/stage1/behavior/vector.zig b/test/stage1/behavior/vector.zig
index 2638bb42ff..851074e0d1 100644
--- a/test/stage1/behavior/vector.zig
+++ b/test/stage1/behavior/vector.zig
@@ -1,4 +1,5 @@
const std = @import("std");
+const builtin = @import("builtin");
const mem = std.mem;
const math = std.math;
const expect = std.testing.expect;
@@ -387,6 +388,9 @@ test "vector bitwise not operator" {
}
test "vector shift operators" {
+ // TODO investigate why this fails when cross-compiled to wasm.
+ if (builtin.os.tag == .wasi) return error.SkipZigTest;
+
const S = struct {
fn doTheTestShift(x: var, y: var) void {
const N = @typeInfo(@TypeOf(x)).Array.len;
diff --git a/test/tests.zig b/test/tests.zig
index 3b70d0e36b..74aa9b105a 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -483,15 +483,6 @@ pub fn addPkgTests(
if (skip_non_native and !test_target.target.isNative())
continue;
- if (!is_wasmtime_enabled) {
- if (test_target.target.os_tag) |tag| {
- if (tag == .wasi) {
- warn("Skipping {} on wasm32-wasi.\n", .{root_src});
- continue;
- }
- }
- }
-
if (skip_libc and test_target.link_libc)
continue;