Daniel Malea | 137c4d7 | 2013-02-28 23:11:46 +0000 | [diff] [blame] | 1 | function(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 | ) |
| 12 | endfunction() |
| 13 | |
Daniel Malea | ab3d87a | 2013-03-07 00:50:54 +0000 | [diff] [blame] | 14 | string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}) |
| 15 | |
Daniel Malea | 137c4d7 | 2013-02-28 23:11:46 +0000 | [diff] [blame] | 16 | # Users can override LLDB_TEST_ARGS to modify the way LLDB tests are run. See help below. |
| 17 | set(LLDB_TEST_ARGS |
| 18 | -C |
Daniel Malea | ab3d87a | 2013-03-07 00:50:54 +0000 | [diff] [blame] | 19 | ${LLDB_TEST_COMPILER} |
Daniel Malea | 137c4d7 | 2013-02-28 23:11:46 +0000 | [diff] [blame] | 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 | ) |
| 22 | string(REPLACE " " ";" LLDB_TEST_ARGS ${LLDB_TEST_ARGS}) |
| 23 | |
| 24 | set(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 | |
| 28 | set(LLDB_COMMON_TEST_ARGS |
Daniel Malea | 137c4d7 | 2013-02-28 23:11:46 +0000 | [diff] [blame] | 29 | --executable |
| 30 | ${CMAKE_BINARY_DIR}/bin/lldb |
| 31 | -s |
| 32 | ${LLDB_TRACE_DIR} |
Daniel Malea | f1bc35d | 2013-05-13 21:41:35 +0000 | [diff] [blame] | 33 | -u CXXFLAGS |
| 34 | -u CFLAGS |
Daniel Malea | 137c4d7 | 2013-02-28 23:11:46 +0000 | [diff] [blame] | 35 | ) |
| 36 | |
| 37 | add_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 | |
| 43 | set(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. |
| 49 | add_python_test_target(check-lldb |
| 50 | ${LLDB_SOURCE_DIR}/test/dosep.ty |
| 51 | "${LLDB_DOSEP_ARGS}" |
Daniel Malea | 0856107 | 2013-03-05 21:59:12 +0000 | [diff] [blame] | 52 | "Testing LLDB (with a separate subprocess per test)" |
Daniel Malea | 137c4d7 | 2013-02-28 23:11:46 +0000 | [diff] [blame] | 53 | ) |