summaryrefslogtreecommitdiff
path: root/Tests/Kernel
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-09-01 23:44:24 -0600
committerAndreas Kling <kling@serenityos.org>2021-09-02 09:08:23 +0200
commit58797a1289b2719b731dbb6a81e064fd4786db03 (patch)
tree5e760452feb85d9d3486c744dd1097e69aa81e6c /Tests/Kernel
parentb5a145b46677dd0853ffa65842a2a6cfe06ca061 (diff)
downloadserenity-58797a1289b2719b731dbb6a81e064fd4786db03.zip
Tests: Remove all file(GLOB) from CMakeLists in Tests
Using a file(GLOB) to find all the test files in a directory is an easy hack to get things started, but has some drawbacks. Namely, if you add a test, it won't be found again without re-running CMake. `ninja` seems to do this automatically, but it would be nice to one day stop seeing it rechecking our globbed directories.
Diffstat (limited to 'Tests/Kernel')
-rw-r--r--Tests/Kernel/CMakeLists.txt48
-rw-r--r--Tests/Kernel/mprotect-multi-region-mprotect.cpp (renamed from Tests/Kernel/mprotect-multi-region-mrotect.cpp)0
2 files changed, 38 insertions, 10 deletions
diff --git a/Tests/Kernel/CMakeLists.txt b/Tests/Kernel/CMakeLists.txt
index 36c3381b0c..91ecf7338a 100644
--- a/Tests/Kernel/CMakeLists.txt
+++ b/Tests/Kernel/CMakeLists.txt
@@ -1,18 +1,46 @@
-file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp")
-file(GLOB LIBTEST_BASED_SOURCES "Test*.cpp")
-list(REMOVE_ITEM CMD_SOURCES ${LIBTEST_BASED_SOURCES})
+set(TEST_SOURCES
+ bind-local-socket-to-symlink.cpp
+ bxvga-mmap-kernel-into-userspace.cpp
+ crash-fcntl-invalid-cmd.cpp
+ elf-execve-mmap-race.cpp
+ elf-symbolication-kernel-read-exploit.cpp
+ fuzz-syscalls.cpp
+ kill-pidtid-confusion.cpp
+ mmap-write-into-running-programs-executable-file.cpp
+ mprotect-multi-region-mprotect.cpp
+ munmap-multi-region-unmapping.cpp
+ nanosleep-race-outbuf-munmap.cpp
+ null-deref-close-during-select.cpp
+ null-deref-crash-during-pthread_join.cpp
+ path-resolution-race.cpp
+ pthread-cond-timedwait-example.cpp
+ setpgid-across-sessions-without-leader.cpp
+ stress-truncate.cpp
+ stress-writeread.cpp
+ uaf-close-while-blocked-in-read.cpp
+ unveil-symlinks.cpp
+)
# FIXME: These tests do not use LibTest
-foreach(CMD_SRC ${CMD_SOURCES})
- get_filename_component(CMD_NAME ${CMD_SRC} NAME_WE)
- add_executable(${CMD_NAME} ${CMD_SRC})
- target_link_libraries(${CMD_NAME} LibCore)
- install(TARGETS ${CMD_NAME} RUNTIME DESTINATION usr/Tests/Kernel/Legacy)
+foreach(source IN LISTS TEST_SOURCES)
+ get_filename_component(test_name "${source}" NAME_WE)
+ add_executable("${test_name}" "${source}")
+ target_link_libraries("${test_name}" LibCore)
+ install(TARGETS "${test_name}" RUNTIME DESTINATION usr/Tests/Kernel/Legacy)
endforeach()
+set(LIBTEST_BASED_SOURCES
+ TestEFault.cpp
+ TestKernelAlarm.cpp
+ TestKernelFilePermissions.cpp
+ TestKernelPledge.cpp
+ TestKernelUnveil.cpp
+ TestMunMap.cpp
+ TestProcFS.cpp
+)
-foreach(TEST_SRC ${LIBTEST_BASED_SOURCES})
- serenity_test(${TEST_SRC} Kernel)
+foreach(libtest_source IN LISTS LIBTEST_BASED_SOURCES)
+ serenity_test("${libtest_source}" Kernel)
endforeach()
target_link_libraries(elf-execve-mmap-race LibPthread)
diff --git a/Tests/Kernel/mprotect-multi-region-mrotect.cpp b/Tests/Kernel/mprotect-multi-region-mprotect.cpp
index 68308fd1ae..68308fd1ae 100644
--- a/Tests/Kernel/mprotect-multi-region-mrotect.cpp
+++ b/Tests/Kernel/mprotect-multi-region-mprotect.cpp