Further improve cocmd interpreter

This commit is contained in:
Justine Tunney 2022-10-12 10:44:54 -07:00
parent 0cee831da3
commit 0f89140882
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
14 changed files with 278 additions and 181 deletions

View file

@ -17,12 +17,14 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/calls.h"
#include "libc/dce.h"
#include "libc/mem/copyfd.internal.h"
#include "libc/mem/gc.h"
#include "libc/paths.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/sig.h"
#include "libc/testlib/ezbench.h"
#include "libc/testlib/testlib.h"
#include "libc/x/x.h"
@ -105,3 +107,12 @@ TEST(system, notequals) {
ASSERT_EQ(1, WEXITSTATUS(system("test a != a")));
ASSERT_EQ(0, WEXITSTATUS(system("test a != b")));
}
TEST(system, usleep) {
ASSERT_EQ(0, WEXITSTATUS(system("usleep & kill $!")));
}
TEST(system, kill) {
int ws = system("kill -TERM $$; usleep");
if (!IsWindows()) ASSERT_EQ(SIGTERM, WTERMSIG(ws));
}