merge test-user-mode and test-baremetal into test-executables

Differentiate with --mode userland vs --mode baremetal.

The code was basically copied, now it's DRY.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-29 00:00:01 +00:00
parent 6994dc21af
commit fedb68c62c
11 changed files with 84 additions and 130 deletions

39
test-test-executables Executable file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# https://github.com/cirosantilli/linux-kernel-module-cheat#cli-script-tests
set -eux
./build-userland
./build-userland-in-tree
f="$(tempfile)"
./test-executables | tee "$f"
grep -E '^PASS .* userland/c/hello' "$f"
grep -E '^PASS .* userland/posix/uname' "$f"
./test-executables userland | tee "$f"
grep -E '^PASS .* userland/c/hello' "$f"
grep -E '^PASS .* userland/posix/uname' "$f"
./test-executables userland/c | tee "$f"
grep -E '^PASS .* userland/c/hello' "$f"
! grep -E '^PASS .* userland/posix/uname' "$f"
./test-executables userland/c/hello.c | tee "$f"
grep -E '^PASS .* userland/c/hello' "$f"
! grep -E '^PASS .* userland/c/false' "$f"
! grep -E '^PASS .* userland/posix/uname' "$f"
./test-executables-in-tree | tee "$f"
grep -E '^PASS .* userland/c/hello' "$f"
grep -E '^PASS .* userland/posix/uname' "$f"
cd userland
./test
grep -E '^PASS .* userland/c/hello' "$f"
grep -E '^PASS .* userland/posix/uname' "$f"
cd ..
rm "$f"