diff --git a/api/src/imp/fs/ctl.rs b/api/src/imp/fs/ctl.rs index 3d9415dc..653e66bb 100644 --- a/api/src/imp/fs/ctl.rs +++ b/api/src/imp/fs/ctl.rs @@ -207,6 +207,11 @@ pub fn sys_link( sys_linkat(AT_FDCWD, old_path, AT_FDCWD, new_path, 0) } +#[cfg(target_arch = "x86_64")] +pub fn sys_unlink(path: UserConstPtr) -> LinuxResult { + sys_unlinkat(AT_FDCWD, path, 0) +} + /// remove link of specific file (can be used to delete file) /// dir_fd: the directory of link to be removed /// path: the name of link to be removed diff --git a/apps/oscomp/judge_libctest.py b/apps/oscomp/judge_libctest.py index 3c7e0444..51ce0547 100644 --- a/apps/oscomp/judge_libctest.py +++ b/apps/oscomp/judge_libctest.py @@ -2,7 +2,14 @@ import sys # TODO: Add more commands to test here -libctest_baseline = """""" +libctest_baseline = """ +========== START entry-static.exe argv ========== +Pass! +========== END entry-static.exe argv ========== +========== START entry-static.exe fdopen ========== +Pass! +========== END entry-static.exe fdopen ========== +""" bypass_testkey = [ "libctest static fpclassify_invalid_ld80", @@ -15,6 +22,7 @@ def parse_libctest(output): ans = {} key = "" for line in output.split("\n"): + line = line.replace('\n', '').replace('\r', '') if "START entry-static.exe" in line: key = "libctest static " + line.split(" ")[3] elif "START entry-dynamic.exe" in line: diff --git a/scripts/oscomp_test.sh b/scripts/oscomp_test.sh index 1064fdfd..72a3564b 100755 --- a/scripts/oscomp_test.sh +++ b/scripts/oscomp_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -TIMEOUT=60s +TIMEOUT=600s EXIT_STATUS=0 ROOT=$(realpath $(dirname $0))/../ AX_ROOT=$ROOT/.arceos @@ -25,7 +25,9 @@ if [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "riscv64" ] && [ "$ARCH" != "aarch64" fi LIBC=musl - +if [ -z "$LIBC" ]; then + LIBC=musl +fi if [ "$LIBC" != "musl" ] && [ "$LIBC" != "glibc" ]; then echo "Unknown libc: $LIBC" exit $S_FAILED @@ -68,7 +70,10 @@ basic_testlist=( busybox_testlist=("/$LIBC/busybox sh /$LIBC/busybox_testcode.sh") iozone_testlist=("/$LIBC/busybox sh /$LIBC/iozone_testcode.sh") lua_testlist=("/$LIBC/busybox sh /$LIBC/lua_testcode.sh") -libctest_testlist=("/$LIBC/busybox sh /$LIBC/libctest_testcode.sh") +libctest_testlist=( + "/$LIBC/runtest.exe -w entry-static.exe argv" + "/$LIBC/runtest.exe -w entry-static.exe fdopen" +) testcases_type=( "basic"