test-test-executables 961 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env bash
  2. # https://cirosantilli.com/linux-kernel-module-cheat#cli-script-tests
  3. set -eux
  4. ./build-userland
  5. ./build-userland-in-tree
  6. f="$(tempfile)"
  7. ./test-executables | tee "$f"
  8. grep -E '^PASS .* userland/c/hello' "$f"
  9. grep -E '^PASS .* userland/posix/uname' "$f"
  10. ./test-executables userland | tee "$f"
  11. grep -E '^PASS .* userland/c/hello' "$f"
  12. grep -E '^PASS .* userland/posix/uname' "$f"
  13. ./test-executables userland/c | tee "$f"
  14. grep -E '^PASS .* userland/c/hello' "$f"
  15. ! grep -E '^PASS .* userland/posix/uname' "$f"
  16. ./test-executables userland/c/hello.c | tee "$f"
  17. grep -E '^PASS .* userland/c/hello' "$f"
  18. ! grep -E '^PASS .* userland/c/false' "$f"
  19. ! grep -E '^PASS .* userland/posix/uname' "$f"
  20. ./test-executables-in-tree | tee "$f"
  21. grep -E '^PASS .* userland/c/hello' "$f"
  22. grep -E '^PASS .* userland/posix/uname' "$f"
  23. cd userland
  24. ./test
  25. grep -E '^PASS .* userland/c/hello' "$f"
  26. grep -E '^PASS .* userland/posix/uname' "$f"
  27. cd ..
  28. rm "$f"