mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 19:32:17 +00:00
get expect-fx to actually run
This commit is contained in:
parent
6c77ee2c00
commit
3aa4ebb02f
8 changed files with 122 additions and 63 deletions
|
@ -1,10 +1,5 @@
|
|||
const std = @import("std");
|
||||
|
||||
extern fn shm_open(name: *const i8, oflag: c_int, mode: c_uint) c_int;
|
||||
extern fn mmap(addr: ?*anyopaque, length: c_uint, prot: c_int, flags: c_int, fd: c_int, offset: c_uint) *anyopaque;
|
||||
extern fn kill(pid: c_int, sig: c_int) c_int;
|
||||
extern fn getppid() c_int;
|
||||
|
||||
const SIGUSR1: c_int = 10;
|
||||
|
||||
const O_RDWR: c_int = 2;
|
||||
|
@ -26,9 +21,3 @@ pub fn setSharedBuffer(ptr: [*]u8, length: usize) callconv(.C) usize {
|
|||
pub fn expectFailedStart() callconv(.C) [*]u8 {
|
||||
return SHARED_BUFFER.ptr;
|
||||
}
|
||||
|
||||
pub fn expectFailedFinalize() callconv(.C) void {
|
||||
const parent_pid = getppid();
|
||||
|
||||
_ = kill(parent_pid, SIGUSR1);
|
||||
}
|
||||
|
|
|
@ -168,7 +168,6 @@ comptime {
|
|||
|
||||
if (builtin.target.cpu.arch != .wasm32) {
|
||||
exportUtilsFn(expect.expectFailedStart, "expect_failed_start");
|
||||
exportUtilsFn(expect.expectFailedFinalize, "expect_failed_finalize");
|
||||
|
||||
// sets the buffer used for expect failures
|
||||
@export(expect.setSharedBuffer, .{ .name = "set_shared_buffer", .linkage = .Weak });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue