From 58797a1289b2719b731dbb6a81e064fd4786db03 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Wed, 1 Sep 2021 23:44:24 -0600 Subject: 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. --- Tests/AK/CMakeLists.txt | 4 +- Tests/Kernel/CMakeLists.txt | 48 ++++++++++++---- Tests/Kernel/mprotect-multi-region-mprotect.cpp | 75 +++++++++++++++++++++++++ Tests/Kernel/mprotect-multi-region-mrotect.cpp | 75 ------------------------- Tests/LibCompress/CMakeLists.txt | 10 +++- Tests/LibCore/CMakeLists.txt | 15 +++-- Tests/LibCpp/CMakeLists.txt | 9 ++- Tests/LibCrypto/CMakeLists.txt | 14 ++++- Tests/LibELF/CMakeLists.txt | 8 ++- Tests/LibGfx/CMakeLists.txt | 10 +++- Tests/LibIMAP/CMakeLists.txt | 8 ++- Tests/LibM/CMakeLists.txt | 8 ++- Tests/LibMarkdown/CMakeLists.txt | 9 ++- Tests/LibPthread/CMakeLists.txt | 9 ++- Tests/LibRegex/CMakeLists.txt | 10 +++- Tests/LibSQL/CMakeLists.txt | 14 ++++- Tests/LibTLS/CMakeLists.txt | 9 ++- Tests/LibThreading/CMakeLists.txt | 9 ++- Tests/LibUnicode/CMakeLists.txt | 9 ++- Tests/LibWeb/CMakeLists.txt | 9 ++- Tests/UserspaceEmulator/CMakeLists.txt | 15 +++-- 21 files changed, 229 insertions(+), 148 deletions(-) create mode 100644 Tests/Kernel/mprotect-multi-region-mprotect.cpp delete mode 100644 Tests/Kernel/mprotect-multi-region-mrotect.cpp (limited to 'Tests') diff --git a/Tests/AK/CMakeLists.txt b/Tests/AK/CMakeLists.txt index 759ca6aa68..30429cc93a 100644 --- a/Tests/AK/CMakeLists.txt +++ b/Tests/AK/CMakeLists.txt @@ -70,6 +70,6 @@ set(AK_TEST_SOURCES TestWeakPtr.cpp ) -foreach(source ${AK_TEST_SOURCES}) - serenity_test(${source} AK) +foreach(source IN LISTS AK_TEST_SOURCES) + serenity_test("${source}" AK) endforeach() 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-mprotect.cpp b/Tests/Kernel/mprotect-multi-region-mprotect.cpp new file mode 100644 index 0000000000..68308fd1ae --- /dev/null +++ b/Tests/Kernel/mprotect-multi-region-mprotect.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +int main() +{ + printf("Testing full unnmap\n"); + auto* map1 = mmap(nullptr, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0); + if (map1 == MAP_FAILED) { + perror("mmap 1"); + return 1; + } + auto* map2 = mmap((void*)((FlatPtr)map1 + 2 * PAGE_SIZE), 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0); + if (map2 == MAP_FAILED) { + perror("mmap 2"); + return 1; + } + auto* map3 = mmap((void*)((FlatPtr)map1 + 4 * PAGE_SIZE), 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0); + if (map3 == MAP_FAILED) { + perror("mmap 3"); + return 1; + } + + // really allocating pages + memset(map1, 0x01, 6 * PAGE_SIZE); + + int rc; + + outln("Mprotect 3 ranges [2, 2 ,2]"); + rc = mprotect(map1, 6 * PAGE_SIZE, PROT_READ); + if (rc) { + perror("mprotect full"); + return 1; + } + + outln("Mprotect 3 ranges [-1, 2 ,1-]"); + rc = mprotect((void*)((FlatPtr)map1 + PAGE_SIZE), 4 * PAGE_SIZE, PROT_READ); + if (rc) { + perror("mprotect partial"); + return 1; + } + + outln("unmapping"); + munmap(map2, 2 * PAGE_SIZE); + + outln("Mprotect 2 ranges [2, -- ,2] -> Error"); + rc = mprotect(map1, 6 * PAGE_SIZE, PROT_READ); + if (!rc) { + perror("mprotect full over missing succeded"); + return 1; + } + + outln("Mprotect 3 ranges [-1, -- ,1-] -> Error"); + rc = mprotect((void*)((FlatPtr)map1 + PAGE_SIZE), 4 * PAGE_SIZE, PROT_READ); + if (!rc) { + perror("mprotect partial over missing succeeded"); + return 1; + } + + //cleanup + munmap(map1, 6 * PAGE_SIZE); + + outln("PASS"); + return 0; +} diff --git a/Tests/Kernel/mprotect-multi-region-mrotect.cpp b/Tests/Kernel/mprotect-multi-region-mrotect.cpp deleted file mode 100644 index 68308fd1ae..0000000000 --- a/Tests/Kernel/mprotect-multi-region-mrotect.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2021, the SerenityOS developers. - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#include -#include -#include -#include -#include -#include -#include - -int main() -{ - printf("Testing full unnmap\n"); - auto* map1 = mmap(nullptr, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0); - if (map1 == MAP_FAILED) { - perror("mmap 1"); - return 1; - } - auto* map2 = mmap((void*)((FlatPtr)map1 + 2 * PAGE_SIZE), 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0); - if (map2 == MAP_FAILED) { - perror("mmap 2"); - return 1; - } - auto* map3 = mmap((void*)((FlatPtr)map1 + 4 * PAGE_SIZE), 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0); - if (map3 == MAP_FAILED) { - perror("mmap 3"); - return 1; - } - - // really allocating pages - memset(map1, 0x01, 6 * PAGE_SIZE); - - int rc; - - outln("Mprotect 3 ranges [2, 2 ,2]"); - rc = mprotect(map1, 6 * PAGE_SIZE, PROT_READ); - if (rc) { - perror("mprotect full"); - return 1; - } - - outln("Mprotect 3 ranges [-1, 2 ,1-]"); - rc = mprotect((void*)((FlatPtr)map1 + PAGE_SIZE), 4 * PAGE_SIZE, PROT_READ); - if (rc) { - perror("mprotect partial"); - return 1; - } - - outln("unmapping"); - munmap(map2, 2 * PAGE_SIZE); - - outln("Mprotect 2 ranges [2, -- ,2] -> Error"); - rc = mprotect(map1, 6 * PAGE_SIZE, PROT_READ); - if (!rc) { - perror("mprotect full over missing succeded"); - return 1; - } - - outln("Mprotect 3 ranges [-1, -- ,1-] -> Error"); - rc = mprotect((void*)((FlatPtr)map1 + PAGE_SIZE), 4 * PAGE_SIZE, PROT_READ); - if (!rc) { - perror("mprotect partial over missing succeeded"); - return 1; - } - - //cleanup - munmap(map1, 6 * PAGE_SIZE); - - outln("PASS"); - return 0; -} diff --git a/Tests/LibCompress/CMakeLists.txt b/Tests/LibCompress/CMakeLists.txt index bfd8880d1d..4569090371 100644 --- a/Tests/LibCompress/CMakeLists.txt +++ b/Tests/LibCompress/CMakeLists.txt @@ -1,5 +1,9 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + TestDeflate.cpp + TestGzip.cpp + TestZlib.cpp +) -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibCompress LIBS LibCompress) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibCompress LIBS LibCompress) endforeach() diff --git a/Tests/LibCore/CMakeLists.txt b/Tests/LibCore/CMakeLists.txt index 5143662458..b77b556bfb 100644 --- a/Tests/LibCore/CMakeLists.txt +++ b/Tests/LibCore/CMakeLists.txt @@ -1,13 +1,12 @@ -set( - TEST_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/TestLibCoreArgsParser.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/TestLibCoreFileWatcher.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/TestLibCoreIODevice.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/TestLibCoreDeferredInvoke.cpp +set(TEST_SOURCES + TestLibCoreArgsParser.cpp + TestLibCoreFileWatcher.cpp + TestLibCoreIODevice.cpp + TestLibCoreDeferredInvoke.cpp ) -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibCore) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibCore) endforeach() install(FILES long_lines.txt DESTINATION usr/Tests/LibCore) diff --git a/Tests/LibCpp/CMakeLists.txt b/Tests/LibCpp/CMakeLists.txt index cbcd3b7488..1dd7bbe634 100644 --- a/Tests/LibCpp/CMakeLists.txt +++ b/Tests/LibCpp/CMakeLists.txt @@ -1,5 +1,8 @@ -file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + test-cpp-parser.cpp + test-cpp-preprocessor.cpp +) -foreach(CMD_SRC ${CMD_SOURCES}) - serenity_test(${CMD_SRC} LibCpp LIBS LibCpp) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibCpp LIBS LibCpp) endforeach() diff --git a/Tests/LibCrypto/CMakeLists.txt b/Tests/LibCrypto/CMakeLists.txt index e376215ab1..cc14627b0a 100644 --- a/Tests/LibCrypto/CMakeLists.txt +++ b/Tests/LibCrypto/CMakeLists.txt @@ -1,4 +1,12 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibCrypto LIBS LibCrypto) +set(TEST_SOURCES + TestAES.cpp + TestBigInteger.cpp + TestChecksum.cpp + TestHash.cpp + TestHMAC.cpp + TestRSA.cpp +) + +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibCrypto LIBS LibCrypto) endforeach() diff --git a/Tests/LibELF/CMakeLists.txt b/Tests/LibELF/CMakeLists.txt index c4bbaf4fa5..ab5a9f200a 100644 --- a/Tests/LibELF/CMakeLists.txt +++ b/Tests/LibELF/CMakeLists.txt @@ -1,5 +1,7 @@ -file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + test-elf.cpp +) -foreach(CMD_SRC ${CMD_SOURCES}) - serenity_test(${CMD_SRC} LibELF) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibELF) endforeach() diff --git a/Tests/LibGfx/CMakeLists.txt b/Tests/LibGfx/CMakeLists.txt index cee5cfbe62..cf18c0e162 100644 --- a/Tests/LibGfx/CMakeLists.txt +++ b/Tests/LibGfx/CMakeLists.txt @@ -1,5 +1,9 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + BenchmarkGfxPainter.cpp + TestFontHandling.cpp + TestImageDecoder.cpp +) -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibGfx LIBS LibGUI) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibGfx LIBS LibGUI) endforeach() diff --git a/Tests/LibIMAP/CMakeLists.txt b/Tests/LibIMAP/CMakeLists.txt index c8a213d427..9ca8e420e0 100644 --- a/Tests/LibIMAP/CMakeLists.txt +++ b/Tests/LibIMAP/CMakeLists.txt @@ -1,5 +1,7 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + TestQuotedPrintable.cpp +) -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibIMAP LIBS LibIMAP) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibIMAP LIBS LibIMAP) endforeach() diff --git a/Tests/LibM/CMakeLists.txt b/Tests/LibM/CMakeLists.txt index 831178c3d5..7b1c78178d 100644 --- a/Tests/LibM/CMakeLists.txt +++ b/Tests/LibM/CMakeLists.txt @@ -1,6 +1,8 @@ -file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + test-math.cpp +) add_compile_options(-fno-builtin) -foreach(CMD_SRC ${CMD_SOURCES}) - serenity_test(${CMD_SRC} LibM) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibM) endforeach() diff --git a/Tests/LibMarkdown/CMakeLists.txt b/Tests/LibMarkdown/CMakeLists.txt index a9c5d179a1..b69c3013b1 100644 --- a/Tests/LibMarkdown/CMakeLists.txt +++ b/Tests/LibMarkdown/CMakeLists.txt @@ -1,6 +1,9 @@ include(${SERENITY_PROJECT_ROOT}/Meta/CMake/commonmark_spec.cmake) -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibMarkdown LIBS LibMarkdown) +set(TEST_SOURCES + TestCommonmark.cpp +) + +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibMarkdown LIBS LibMarkdown) endforeach() diff --git a/Tests/LibPthread/CMakeLists.txt b/Tests/LibPthread/CMakeLists.txt index 2b0209e4ef..9ee09f36b9 100644 --- a/Tests/LibPthread/CMakeLists.txt +++ b/Tests/LibPthread/CMakeLists.txt @@ -1,4 +1,7 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibPthread LIBS LibPthread) +set(TEST_SOURCES + TestLibPthreadSpinLocks.cpp +) + +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibPthread LIBS LibPthread) endforeach() diff --git a/Tests/LibRegex/CMakeLists.txt b/Tests/LibRegex/CMakeLists.txt index 1b81dcf482..eeeacecfba 100644 --- a/Tests/LibRegex/CMakeLists.txt +++ b/Tests/LibRegex/CMakeLists.txt @@ -1,5 +1,9 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + Benchmark.cpp + Regex.cpp + RegexLibC.cpp +) -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibRegex LIBS LibRegex) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibRegex LIBS LibRegex) endforeach() diff --git a/Tests/LibSQL/CMakeLists.txt b/Tests/LibSQL/CMakeLists.txt index 787696fb33..fd5a442d7e 100644 --- a/Tests/LibSQL/CMakeLists.txt +++ b/Tests/LibSQL/CMakeLists.txt @@ -1,5 +1,13 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + TestSqlBtreeIndex.cpp + TestSqlDatabase.cpp + TestSqlExpressionParser.cpp + TestSqlHashIndex.cpp + TestSqlStatementExecution.cpp + TestSqlStatementParser.cpp + TestSqlValueAndTuple.cpp +) -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibSQL LIBS LibSQL LibIPC) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibSQL LIBS LibSQL LibIPC) endforeach() diff --git a/Tests/LibTLS/CMakeLists.txt b/Tests/LibTLS/CMakeLists.txt index 4896f8f016..282a940406 100644 --- a/Tests/LibTLS/CMakeLists.txt +++ b/Tests/LibTLS/CMakeLists.txt @@ -1,4 +1,7 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibTLS LIBS LibTLS LibCrypto) +set(TEST_SOURCES + TestTLSHandshake.cpp +) + +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibTLS LIBS LibTLS LibCrypto) endforeach() diff --git a/Tests/LibThreading/CMakeLists.txt b/Tests/LibThreading/CMakeLists.txt index 40021e9d4a..355100fea2 100644 --- a/Tests/LibThreading/CMakeLists.txt +++ b/Tests/LibThreading/CMakeLists.txt @@ -1,4 +1,7 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibThreading LIBS LibThreading LibPthread) +set(TEST_SOURCES + TestThread.cpp +) + +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibThreading LIBS LibThreading LibPthread) endforeach() diff --git a/Tests/LibUnicode/CMakeLists.txt b/Tests/LibUnicode/CMakeLists.txt index a8ef1ab9da..e79b48be92 100644 --- a/Tests/LibUnicode/CMakeLists.txt +++ b/Tests/LibUnicode/CMakeLists.txt @@ -1,5 +1,8 @@ -file(GLOB TEST_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + TestUnicodeCharacterTypes.cpp + TestUnicodeLocale.cpp +) -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibUnicode LIBS LibUnicode) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibUnicode LIBS LibUnicode) endforeach() diff --git a/Tests/LibWeb/CMakeLists.txt b/Tests/LibWeb/CMakeLists.txt index 63ea33d2cb..4bb687b9e9 100644 --- a/Tests/LibWeb/CMakeLists.txt +++ b/Tests/LibWeb/CMakeLists.txt @@ -1,10 +1,9 @@ -set( - TEST_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/TestHTMLTokenizer.cpp +set(TEST_SOURCES + TestHTMLTokenizer.cpp ) -foreach(source ${TEST_SOURCES}) - serenity_test(${source} LibWeb LIBS LibWeb) +foreach(source IN LISTS TEST_SOURCES) + serenity_test("${source}" LibWeb LIBS LibWeb) endforeach() serenity_testjs_test(test-web.cpp test-web LIBS LibWeb) diff --git a/Tests/UserspaceEmulator/CMakeLists.txt b/Tests/UserspaceEmulator/CMakeLists.txt index 3fbbbc4120..875cbcd9a9 100644 --- a/Tests/UserspaceEmulator/CMakeLists.txt +++ b/Tests/UserspaceEmulator/CMakeLists.txt @@ -1,9 +1,12 @@ -file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp") +set(TEST_SOURCES + test-run-ls.cpp + ue-write-oob.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/UserEmulator) +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/UserEmulator) endforeach() -- cgit v1.2.3