blob: 1c5afb5da597e2da612196faeece1d7086117d89 [file] [log] [blame]
Daniel Malea137c4d72013-02-28 23:11:46 +00001function(add_python_test_target name test_script args comment)
2 set(PYTHON_TEST_COMMAND
3 ${PYTHON_EXECUTABLE}
4 ${test_script}
5 ${args}
6 )
7
8 add_custom_target(${name}
9 COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
10 COMMENT "${comment}"
11 )
12endfunction()
13
Daniel Maleaab3d87a2013-03-07 00:50:54 +000014string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
15
Daniel Malea137c4d72013-02-28 23:11:46 +000016# Users can override LLDB_TEST_ARGS to modify the way LLDB tests are run. See help below.
17set(LLDB_TEST_ARGS
18 -C
Daniel Maleaab3d87a2013-03-07 00:50:54 +000019 ${LLDB_TEST_COMPILER}
Daniel Malea137c4d72013-02-28 23:11:46 +000020 CACHE STRING "Specify compiler(s) and architecture(s) with which run LLDB tests. For example: '-C gcc -C clang -A i386 -A x86_64'"
21 )
22string(REPLACE " " ";" LLDB_TEST_ARGS ${LLDB_TEST_ARGS})
23
24set(LLDB_TRACE_DIR "${CMAKE_BINARY_DIR}/lldb-test-traces"
25 CACHE STRING "Set directory to output LLDB test traces (for tests that do not pass.)"
26 )
27
28set(LLDB_COMMON_TEST_ARGS
Daniel Malea137c4d72013-02-28 23:11:46 +000029 --executable
30 ${CMAKE_BINARY_DIR}/bin/lldb
31 -s
32 ${LLDB_TRACE_DIR}
Daniel Maleaf1bc35d2013-05-13 21:41:35 +000033 -u CXXFLAGS
34 -u CFLAGS
Daniel Malea137c4d72013-02-28 23:11:46 +000035 )
36
37add_python_test_target(check-lldb-single
38 ${LLDB_SOURCE_DIR}/test/dotest.py
39 "${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}"
40 "Testing LLDB with args: ${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}"
41 )
42
43set(LLDB_DOSEP_ARGS
44 -o;\"-q;${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}\"
45 )
46
47# If tests crash cause LLDB to crash, or things are otherwise unstable, or if machine-parsable
48# output is desired (i.e. in continuous integration contexts) check-lldb-sep is a better target.
49add_python_test_target(check-lldb
50 ${LLDB_SOURCE_DIR}/test/dosep.ty
51 "${LLDB_DOSEP_ARGS}"
Daniel Malea08561072013-03-05 21:59:12 +000052 "Testing LLDB (with a separate subprocess per test)"
Daniel Malea137c4d72013-02-28 23:11:46 +000053 )