Add CI targets, fix test_std.js (#247)

This switches the exec test to `SIGTERM` rather than `SIGQUIT` since the
latter didn’t seem to work in QEMU, and the distinction doesn’t really
matter for this test.

This also makes the `isatty()` check smarter by checking whether `STDIN`
is, in fact, a terminal.

Added qemu-alpine targets i386, arm32v6, arm32v7, arm64v8, s390x

Co-authored-by: Felipe Gasper <felipe@felipegasper.com>
This commit is contained in:
Charlie Gordon
2024-03-03 21:57:38 +01:00
committed by GitHub
parent ebe7496d14
commit 6a89d7c270
2 changed files with 58 additions and 31 deletions

View File

@@ -144,8 +144,9 @@ function test_os()
{
var fd, fpath, fname, fdir, buf, buf2, i, files, err, fdate, st, link_path;
// XXX(bnoordhuis) disabled because stdio is not a tty on CI
//assert(os.isatty(0));
const stdinIsTTY = !os.exec(["/bin/sh", "-c", "test -t 0"], { usePath: false });
assert(os.isatty(0), stdinIsTTY, `isatty(STDIN)`);
fdir = "test_tmp_dir";
fname = "tmp_file.txt";
@@ -254,10 +255,11 @@ function test_os_exec()
pid = os.exec(["cat"], { block: false } );
assert(pid >= 0);
os.kill(pid, os.SIGQUIT);
os.kill(pid, os.SIGTERM);
[ret, status] = os.waitpid(pid, 0);
assert(ret, pid);
assert(status & 0x7f, os.SIGQUIT);
assert(status !== 0, true, `expect nonzero exit code (got ${status})`);
assert(status & 0x7f, os.SIGTERM);
}
function test_timer()