Veikka Tuominen
fd77f2cfed
std: update usage of std.testing
2021-05-08 15:15:30 +03:00
Michael Dusan
84d5cc31c5
fix test to restore cwd after chdir
...
- `../zig-cache/tmp` is no longer created by subsequent test(s)
2021-05-07 01:04:38 -04:00
Andrew Kelley
429cd2b5dd
std: change @import("builtin") to std.builtin
2021-04-15 19:06:39 -07:00
Andrew Kelley
04b8354702
freebsd: disable failing test
...
See #8538
2021-04-15 00:59:40 -07:00
LemonBoy
566adc2510
std: Swap arguments in Thread.spawn
...
Beside the new order being consistent with the ThreadPool API and making
more sense, this shuffling allows to write the context argument type in
terms of the startFn arguments, reducing the use of anytype (eg. less
explicit casts when using comptime_int parameters, yay).
Sorry for the breakage.
Closes #8082
2021-02-28 14:03:19 +01:00
Tau
840331ee48
Rebase link(at) properly
2021-02-21 12:04:40 +02:00
Jay Petacat
a9b505fa77
Reduce use of deprecated IO types
...
Related: #4917
2021-01-07 23:48:58 -08:00
Frank Denis
6c2e0c2046
Year++
2020-12-31 15:45:24 -08:00
LemonBoy
3a759fdb17
Disable sigaction test on i386 because of #7427
2020-12-13 19:35:40 +01:00
LemonBoy
fc70db5ab5
std: Fixes for siginfo test on macos
...
Xnu's sigaction() only supports fetching a limited set of sa_flags, test
SA_SIGINFO instead of SA_RESETHAND as that's supported everywhere.
Add another check to make sure SA_RESETHAND works.
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2020-12-13 19:17:04 +01:00
LemonBoy
629cc6cf28
std: Further siginfo refinements
...
* Define siginfo and sigaction for Darwin
* Define sigaction/handler union for maximum libc compatibility
* Minor correction to some type definitions
2020-12-12 16:44:10 +01:00
LemonBoy
1d9b28403a
std: Correct check in signal test
...
Ooops.
2020-12-12 15:34:26 +01:00
LemonBoy
beae3cea17
std: Improve sigaction interface
...
Add a smoke test to prevent regressions.
2020-12-12 13:57:25 +01:00
Jonathan Marler
b587a42233
add std.os.shutdown function for sockets
2020-11-30 11:25:03 -08:00
LemonBoy
3e22077d46
Fix the ELF base calculation
...
Find the effective ELF load address in dl_iterate_phdr by computing the
difference between the in-memory phdr and its p_vaddr specified in the
ELF file.
This makes the dl_iterate_phdr test pass and restores the stack traces.
2020-11-23 15:06:07 +01:00
Andrew Kelley
55ab50efbd
Merge branch 'piepiepie' of https://github.com/LemonBoy/zig into pie
...
Conflicts:
lib/std/dynamic_library.zig (fixed in this commit)
src/all_types.hpp
src/codegen.cpp
src/link.cpp
src/main.cpp
Will manually apply the diffs to these deleted files to the new zig
code in a followup commit.
2020-11-22 12:39:44 -07:00
Jakub Konka
663e112773
std: add chdir smoke test
2020-11-18 15:37:44 +01:00
xackus
6418284680
std: add {set,get}rlimit bits and improve test
2020-11-01 15:47:46 -05:00
LemonBoy
8044ed4c66
std: Add basic smoke test for net functionality
2020-10-27 21:52:47 +01:00
Vignesh Rajagopalan
2ab0c7391a
Rename .macosx to .macos
2020-10-12 18:56:25 -04:00
xackus
1b4296831a
simplify api and add smoke test
2020-10-04 23:57:49 +02:00
Jens Goldberg
68818983ae
Split the sync tests into sync and fsync
2020-09-03 09:52:26 +00:00
Jens Goldberg
e747d2ba17
Add C declarations and tests for the sync functions
2020-09-03 07:49:18 +00:00
Sahnvour
ac85befbb4
handle lack of privilege to create symbolic links on windows
2020-08-30 06:52:53 +02:00
Andrew Kelley
4a69b11e74
add license header to all std lib files
...
add SPDX license identifier
copyright ownership is zig contributors
2020-08-20 16:07:04 -04:00
Andrew Kelley
ae2c88754d
std: signalfd: fix the types of things; add test
2020-08-17 16:19:57 -07:00
Andrew Kelley
cf4936bcb0
std.os tests: improve robustness of "symlink with relative paths"
2020-08-04 23:45:53 -07:00
Jakub Konka
4d9eff4bdb
Add prelim openW and openatW
...
Added POSIX functions targeting Windows pass `open` and `openat`
smoke tests.
2020-07-31 16:41:25 +02:00
Jakub Konka
a694f575ad
Add some os.open and os.openat smoke tests
2020-07-31 16:33:02 +02:00
Jakub Konka
66bbe4ec4c
Refactor internal Win routines to reuse OpenFile
...
This covers mainly `ReadLink` and `CreateSymolicLink` functions.
2020-07-31 16:31:44 +02:00
Jakub Konka
65581b37cb
Enable std.os.symlinkat tests on Windows
2020-07-22 08:51:23 +02:00
Jakub Konka
4887350bf4
Finish drafting CreateSymolicLink using NT calls
2020-07-22 08:51:23 +02:00
Jakub Konka
3c8ceb674e
Fix Windows build
2020-07-22 08:51:22 +02:00
Jakub Konka
fc7d87fef1
Move symlink to fs.symlinkAbsolute with SymlinkFlags
...
This way `std.fs.symlinkAbsolute` becomes cross-platform and we can
legally include `SymlinkFlags` as an argument that's only used on
Windows. Also, now `std.os.symlink` generates a compile error on
Windows with a message to instead use `std.os.windows.CreateSymbolicLink`.
Finally, this PR also reshuffles the tests between `std.os.test` and
`std.fs.test`.
2020-07-22 08:51:22 +02:00
Jakub Konka
3ab5e6b1a9
Ensure we use Win32 prefix in Win32 calls
2020-07-22 08:51:22 +02:00
Jakub Konka
cc9c5c5b0e
Handle relative/absolute symlinks; add more tests
2020-07-22 08:51:22 +02:00
Jakub Konka
a8a02dfbfa
Add smoke test for dir symlinks
2020-07-22 08:51:22 +02:00
Jakub Konka
30f1176a54
Add SymlinkFlags needed to create symlinks to dirs on Win
2020-07-22 08:51:22 +02:00
Jakub Konka
4894de2b32
Fix readlink smoke test
2020-07-22 08:51:22 +02:00
Jakub Konka
99e3e29e2e
Refactor
2020-07-22 08:51:22 +02:00
Jakub Konka
c47cb8d09f
Fix unlinkatW to allow file symlink deletion on Windows
2020-07-22 08:51:22 +02:00
Jakub Konka
ae8abedbed
Use NtCreateFile to get handle to reparse point
2020-07-22 08:51:22 +02:00
Jakub Konka
49b5815364
Add windows.ReadLink similar to OpenFile but for reparse points only
2020-07-22 08:51:22 +02:00
Jakub Konka
92d11fd4e9
Debug readlinkW using OpenFile
2020-07-22 08:51:22 +02:00
Jakub Konka
515c663cd6
Add readlink smoke test
2020-07-22 08:51:22 +02:00
Ryan Liptak
626b5eccab
Move fs-specific tests from os/test.zig to fs/test.zig
...
The moved tests do not use `std.os` directly and instead use `std.fs` functions, so it makes more sense for them to be in `fs/test.zig`
2020-06-27 10:17:08 +00:00
Jakub Konka
be78b7b648
Implement fstatat targeting WASI
...
Also, add more informative `@compileError` in a few `std.os` functions
that would otherwise yield a cryptic compile error when targeting
WASI. Finally, enhance docs in a few places and add test case for
`fstatat`.
2020-06-24 21:00:21 +02:00
Jakub Konka
c950f0c6c3
Enhance std.os.readlinkat coverage
...
Adds Windows stub (still needs to be implemented on Windows),
adds WASI implementation, adds unit test testing basic chain of
ops: create file -> symlink -> readlink.
2020-06-22 09:40:06 +02:00
Jakub Konka
64078ca924
Enhance std.os.symlinkat coverage
...
Fixes `std.os.symlinkat` compile errors, adds Windows stub (still
needs to be implemented), adds WASI implementation.
2020-06-22 09:14:51 +02:00
Jakub Konka
2a59ecd7ec
Integrate getTestDir with tmpDir logic
2020-05-18 17:10:49 +02:00