-
-
Notifications
You must be signed in to change notification settings - Fork 260
/
CMakeLists.txt
30 lines (25 loc) · 1.24 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
include(CheckTypeSize)
check_type_size(void* ptr_size)
if(${ptr_size} MATCHES "^4$")
set(model 32)
elseif(${ptr_size} MATCHES "^8$")
set(model 64)
endif()
set(DMD_TEST_MODEL "${model}" CACHE STRING
"The model argument to use for compiling the D2 testsuite. Defaults to system bitness.")
get_property(ldmd_path TARGET ldmd2 PROPERTY LOCATION)
# Build test suite in both debug and release modes. The DFLAGS environment
# variable read by LDMD is used because the DMD testsuite build system
# provides no way to run the test cases with a given set of flags without
# trying all combinations of them.
add_test(NAME dmd-testsuite-debug
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/d2/dmd-testsuite
COMMAND make RESULTS_DIR=${CMAKE_BINARY_DIR}/dmd-testsuite-debug DMD=${ldmd_path} DFLAGS=-gc MODEL=${DMD_TEST_MODEL} quick
)
# Would like to specify the "-release" flag here, but some of the tests (e.g.
# 'testdstress') depend on contracts and invariants being active. Need a solution
# integrated with d_do_test.
add_test(NAME dmd-testsuite-release
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/d2/dmd-testsuite
COMMAND make RESULTS_DIR=${CMAKE_BINARY_DIR}/dmd-testsuite-release DMD=${ldmd_path} DFLAGS=-O3 MODEL=${DMD_TEST_MODEL} quick
)