blob: fd2b0a0e599912814ea9a3ab4d13f4d54438619c [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
14# Users can override LLDB_TEST_ARGS to modify the way LLDB tests are run. See help below.
15set(LLDB_TEST_ARGS
16 -C
17 ${CMAKE_C_COMPILER}
18 CACHE STRING "Specify compiler(s) and architecture(s) with which run LLDB tests. For example: '-C gcc -C clang -A i386 -A x86_64'"
19 )
20string(REPLACE " " ";" LLDB_TEST_ARGS ${LLDB_TEST_ARGS})
21
22set(LLDB_TRACE_DIR "${CMAKE_BINARY_DIR}/lldb-test-traces"
23 CACHE STRING "Set directory to output LLDB test traces (for tests that do not pass.)"
24 )
25
26set(LLDB_COMMON_TEST_ARGS
27 #--headers
28 #${LLDB_SOURCE_DIR}/include
29 --executable
30 ${CMAKE_BINARY_DIR}/bin/lldb
31 -s
32 ${LLDB_TRACE_DIR}
33 )
34
35add_python_test_target(check-lldb-single
36 ${LLDB_SOURCE_DIR}/test/dotest.py
37 "${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}"
38 "Testing LLDB with args: ${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}"
39 )
40
41set(LLDB_DOSEP_ARGS
42 -o;\"-q;${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}\"
43 )
44
45# If tests crash cause LLDB to crash, or things are otherwise unstable, or if machine-parsable
46# output is desired (i.e. in continuous integration contexts) check-lldb-sep is a better target.
47add_python_test_target(check-lldb
48 ${LLDB_SOURCE_DIR}/test/dosep.ty
49 "${LLDB_DOSEP_ARGS}"
Daniel Malea08561072013-03-05 21:59:12 +000050 "Testing LLDB (with a separate subprocess per test)"
Daniel Malea137c4d72013-02-28 23:11:46 +000051 )