forked from rcore-os/zCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rcore-os#151 from rcore-os/libc-test-for-ci
Add libc-test to CI
- Loading branch information
Showing
10 changed files
with
158 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import os | ||
import glob | ||
import subprocess | ||
|
||
# ===============Must Config======================== | ||
|
||
TIMEOUT = 5 # seconds | ||
ZCORE_PATH = '../zCore' | ||
BASE = 'linux/' | ||
OUTPUT_FILE = BASE + 'test-output.txt' | ||
RESULT_FILE = BASE + 'test-result.txt' | ||
CHECK_FILE = BASE + 'test-allow-failed.txt' | ||
|
||
# ============================================== | ||
|
||
passed = set() | ||
failed = set() | ||
timeout = set() | ||
|
||
for path in glob.glob("../rootfs/libc-test/src/*/*.exe"): | ||
path = path[len('../rootfs'):] | ||
# ignore static linked tests | ||
if path.endswith('-static.exe'): | ||
continue | ||
try: | ||
subprocess.run("cd .. && cargo run --release -p linux-loader " + path, | ||
shell=True, timeout=TIMEOUT, check=True) | ||
passed.add(path) | ||
except subprocess.CalledProcessError: | ||
failed.add(path) | ||
except subprocess.TimeoutExpired: | ||
timeout.add(path) | ||
|
||
with open(RESULT_FILE, "w") as f: | ||
print('PASSED:', file=f) | ||
for case in passed: | ||
print(case, file=f) | ||
print('FAILED:', file=f) | ||
for case in failed: | ||
print(case, file=f) | ||
print('TIMEOUT:', file=f) | ||
for case in timeout: | ||
print(case, file=f) | ||
|
||
with open(CHECK_FILE, 'r') as f: | ||
allow_failed = set([case.strip() for case in f.readlines()]) | ||
|
||
check_failed = (failed | timeout) - allow_failed | ||
if check_failed: | ||
print('=== Failed cases ===') | ||
for case in check_failed: | ||
print(case) | ||
exit(1) | ||
else: | ||
print('All checked case passed!') | ||
|
||
os.system('killall linux-loader') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/libc-test/src/common/runtest.exe | ||
/libc-test/src/regression/getpwnam_r-errno.exe | ||
/libc-test/src/regression/pthread_atfork-errno-clobber.exe | ||
/libc-test/src/regression/sigreturn.exe | ||
/libc-test/src/regression/pthread-robust-detach.exe | ||
/libc-test/src/regression/fflush-exit.exe | ||
/libc-test/src/regression/daemon-failure.exe | ||
/libc-test/src/regression/rewind-clear-error.exe | ||
/libc-test/src/regression/statvfs.exe | ||
/libc-test/src/regression/pthread_exit-dtor.exe | ||
/libc-test/src/regression/rlimit-open-files.exe | ||
/libc-test/src/regression/getpwnam_r-crash.exe | ||
/libc-test/src/functional/strptime.exe | ||
/libc-test/src/functional/pthread_cancel-points.exe | ||
/libc-test/src/functional/tls_align_dlopen.exe | ||
/libc-test/src/functional/sem_open.exe | ||
/libc-test/src/functional/tls_init_dlopen.exe | ||
/libc-test/src/functional/ipc_shm.exe | ||
/libc-test/src/functional/vfork.exe | ||
/libc-test/src/functional/strtod_long.exe | ||
/libc-test/src/functional/utime.exe | ||
/libc-test/src/functional/setjmp.exe | ||
/libc-test/src/functional/ipc_sem.exe | ||
/libc-test/src/functional/fcntl.exe | ||
/libc-test/src/functional/ipc_msg.exe | ||
/libc-test/src/functional/socket.exe | ||
/libc-test/src/functional/tls_align.exe | ||
/libc-test/src/functional/pthread_robust.exe | ||
/libc-test/src/math/powf.exe | ||
/libc-test/src/math/fmal.exe | ||
/libc-test/src/regression/pthread_cond_wait-cancel_ignored.exe | ||
/libc-test/src/regression/raise-race.exe | ||
/libc-test/src/regression/pthread_once-deadlock.exe | ||
/libc-test/src/regression/pthread_cond-smasher.exe | ||
/libc-test/src/regression/pthread_condattr_setclock.exe | ||
/libc-test/src/functional/pthread_mutex_pi.exe | ||
/libc-test/src/functional/pthread_cancel.exe | ||
/libc-test/src/functional/pthread_mutex.exe | ||
/libc-test/src/functional/spawn.exe | ||
/libc-test/src/functional/popen.exe | ||
/libc-test/src/regression/execle-env.exe | ||
/libc-test/src/regression/malloc-oom.exe | ||
/libc-test/src/regression/pthread_create-oom.exe | ||
/libc-test/src/regression/setenv-oom.exe | ||
/libc-test/src/regression/flockfile-list.exe | ||
/libc-test/src/regression/malloc-brk-fail.exe |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters