Files
linux-kernel-module-cheat/test-test-executables
2019-07-07 00:00:01 +00:00

40 lines
961 B
Bash
Executable File

#!/usr/bin/env bash
# https://cirosantilli.com/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"