1function(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 14string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}) 15 16# Users can override LLDB_TEST_ARGS to modify the way LLDB tests are run. See help below. 17set(LLDB_TEST_ARGS 18 -C 19 ${LLDB_TEST_COMPILER} 20 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 29 --executable 30 ${CMAKE_BINARY_DIR}/bin/lldb 31 -s 32 ${LLDB_TRACE_DIR} 33 -u CXXFLAGS 34 -u CFLAGS 35 ) 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}" 52 "Testing LLDB (with a separate subprocess per test)" 53 ) 54