Replace build scripts with CMake
Rebuilding everything each time was getting a bit slow.
This commit is contained in:
24
tests/CMakeLists.txt
Normal file
24
tests/CMakeLists.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
add_library(testing testing.c)
|
||||
set_default_target_options(testing)
|
||||
target_include_directories(testing PUBLIC include)
|
||||
|
||||
function(add_test_suite source)
|
||||
string(REGEX REPLACE ".c$" "" name ${source})
|
||||
add_executable(${name} ${source})
|
||||
set_default_target_options(${name})
|
||||
target_link_libraries(${name} PRIVATE lib testing)
|
||||
add_test(NAME ${name} COMMAND ${name})
|
||||
endfunction()
|
||||
|
||||
function(add_test_suites)
|
||||
foreach(source ${ARGN})
|
||||
add_test_suite(${source})
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
add_test_suites(
|
||||
construct_tests.c
|
||||
desugar_tests.c
|
||||
fsa_tests.c
|
||||
parse_tests.c
|
||||
)
|
||||
Reference in New Issue
Block a user