-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (27 loc) · 1.3 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
project (logical)
cmake_minimum_required(VERSION 3.16)
enable_testing()
function(test_program DIRECTORY TESTNAME)
add_test(NAME ${TESTNAME} COMMAND logical ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/${TESTNAME}.dl)
# add_test(NAME ${TESTNAME}-O0 COMMAND logical -O0 ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/${TESTNAME}.dl)
endfunction()
function(test_directory DIRECTORY)
FILE(GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/*.dl)
FOREACH(TESTNAME ${children})
add_test(NAME ${DIRECTORY}/${TESTNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY} COMMAND logical ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/${TESTNAME})
add_test(NAME ${DIRECTORY}/${TESTNAME}-O0 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY} COMMAND logical -O0 ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/${TESTNAME})
ENDFOREACH()
endfunction()
add_subdirectory(src)
add_subdirectory(external/persist/src)
add_subdirectory(modules/stdlib)
add_subdirectory(modules/mysql)
add_subdirectory(tests/externs)
add_subdirectory(modules/parsers)
add_test(NAME UnitTests COMMAND logical-tests)
test_directory(tests/programs)
test_program(tests/mysql mysql)
test_directory(samples)
test_directory(tests/stdlib)
test_directory(tests/parsers)
test_directory(tests/externs)