diff options
author | Marco Biscaro <marcobiscaro2112@gmail.com> | 2021-04-17 23:20:56 -0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-04-21 08:00:32 +0200 |
commit | 8124719c3d2744edfc475155f70a286cb45e72ef (patch) | |
tree | 8f024eab41bbec679645044ff7329ef08900a73f /Meta/Lagom | |
parent | 78733417a471a02567e5cb24506d4003110c44b1 (diff) | |
download | serenity-8124719c3d2744edfc475155f70a286cb45e72ef.zip |
Tests: Reorganize LibCompress unit tests
Move LibCompress unit tests to LibCompress/Tests directory and register
them with CMake's add_test. This allows us to run these tests with
ninja test instead of running a separate executable.
Also split the existing tests in 3 test files that better follow the
source code structure (inspired by AK tests).
Diffstat (limited to 'Meta/Lagom')
-rw-r--r-- | Meta/Lagom/CMakeLists.txt | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 5b21810f42..556345d5ed 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -65,6 +65,7 @@ file(GLOB LIBX86_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibX86/*.cp file(GLOB LIBJS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibJS/*.cpp") file(GLOB LIBJS_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibJS/*/*.cpp") file(GLOB LIBCOMPRESS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCompress/*.cpp") +file(GLOB LIBCOMPRESS_TESTS CONFIGURE_DEPENDS "../../Userland/Libraries/LibCompress/Tests/*.cpp") file(GLOB LIBCRYPTO_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*.cpp") file(GLOB LIBCRYPTO_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*/*.cpp") file(GLOB LIBTLS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTLS/*.cpp") @@ -140,16 +141,6 @@ if (BUILD_LAGOM) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) - add_executable(test-compress_lagom ../../Userland/Utilities/test-compress.cpp) - set_target_properties(test-compress_lagom PROPERTIES OUTPUT_NAME test-compress) - target_link_libraries(test-compress_lagom Lagom) - target_link_libraries(test-compress_lagom stdc++) - add_test( - NAME Compress - COMMAND test-compress_lagom - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - add_executable(disasm_lagom ../../Userland/Utilities/disasm.cpp) set_target_properties(disasm_lagom PROPERTIES OUTPUT_NAME disasm) target_link_libraries(disasm_lagom Lagom) @@ -208,6 +199,17 @@ if (BUILD_LAGOM) ) endforeach() + foreach(source ${LIBCOMPRESS_TESTS}) + get_filename_component(name ${source} NAME_WE) + add_executable(${name}_lagom ${source} ${LIBCOMPRESS_SOURCES}) + target_link_libraries(${name}_lagom Lagom) + add_test( + NAME ${name}_lagom + COMMAND ${name}_lagom + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + endforeach() + foreach(source ${LIBSQL_TEST_SOURCES}) get_filename_component(name ${source} NAME_WE) add_executable(${name}_lagom ${source} ${LIBSQL_SOURCES}) |