diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-04-22 13:36:26 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-04-22 13:36:26 -0400 |
| commit | da2af9c613841552e9e47b6c9f0e9e4ee74894fb (patch) | |
| tree | df31e159e25b97021c9446a21704f79e075e1f2d /std/os | |
| parent | 0dcadc61b4ce8fb3ffb75b8f266bff2c6ae149b6 (diff) | |
| download | zig-da2af9c613841552e9e47b6c9f0e9e4ee74894fb.tar.gz zig-da2af9c613841552e9e47b6c9f0e9e4ee74894fb.zip | |
fixups
Diffstat (limited to 'std/os')
| -rw-r--r-- | std/os/index.zig | 3 | ||||
| -rw-r--r-- | std/os/linux/index.zig | 7 | ||||
| -rw-r--r-- | std/os/linux/test.zig | 2 | ||||
| -rw-r--r-- | std/os/windows/index.zig | 11 |
4 files changed, 9 insertions, 14 deletions
diff --git a/std/os/index.zig b/std/os/index.zig index 8da5c05f06..1916e23db0 100644 --- a/std/os/index.zig +++ b/std/os/index.zig @@ -4,8 +4,7 @@ const Os = builtin.Os; const is_windows = builtin.os == Os.windows; const os = this; -comptime { - if (!builtin.is_test) return; +test "std.os" { _ = @import("child_process.zig"); _ = @import("darwin.zig"); _ = @import("darwin_errno.zig"); diff --git a/std/os/linux/index.zig b/std/os/linux/index.zig index 42c19e91e6..d7924f7159 100644 --- a/std/os/linux/index.zig +++ b/std/os/linux/index.zig @@ -1309,7 +1309,8 @@ pub fn capset(hdrp: &cap_user_header_t, datap: &const cap_user_data_t) usize { return syscall2(SYS_capset, @ptrToInt(hdrp), @ptrToInt(datap)); } -comptime { - if (!builtin.is_test) return; - _ = @import("test.zig"); +test "import" { + if (builtin.os == builtin.Os.linux) { + _ = @import("test.zig"); + } } diff --git a/std/os/linux/test.zig b/std/os/linux/test.zig index f6dc6c2a52..18a6e5f19f 100644 --- a/std/os/linux/test.zig +++ b/std/os/linux/test.zig @@ -4,8 +4,6 @@ const linux = std.os.linux; const assert = std.debug.assert; test "timer" { - if (builtin.os != builtin.Os.linux) return; - const epoll_fd = linux.epoll_create(); var err = linux.getErrno(epoll_fd); assert(err == 0); diff --git a/std/os/windows/index.zig b/std/os/windows/index.zig index 4c127aba04..d6ef7205e8 100644 --- a/std/os/windows/index.zig +++ b/std/os/windows/index.zig @@ -1,10 +1,3 @@ -const builtin = @import("builtin"); -comptime { - if (!builtin.is_test) return; - _ = @import("util.zig"); -} - - pub const ERROR = @import("error.zig"); pub extern "advapi32" stdcallcc fn CryptAcquireContextA(phProv: &HCRYPTPROV, pszContainer: ?LPCSTR, @@ -324,3 +317,7 @@ pub const FILE_END = 2; pub const HEAP_CREATE_ENABLE_EXECUTE = 0x00040000; pub const HEAP_GENERATE_EXCEPTIONS = 0x00000004; pub const HEAP_NO_SERIALIZE = 0x00000001; + +test "import" { + _ = @import("util.zig"); +} |
