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 | |
| 14 | # Users can override LLDB_TEST_ARGS to modify the way LLDB tests are run. See help below. |
| 15 | set(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 | ) |
| 20 | string(REPLACE " " ";" LLDB_TEST_ARGS ${LLDB_TEST_ARGS}) |
| 21 | |
| 22 | set(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 | |
| 26 | set(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 | |
| 35 | add_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 | |
| 41 | set(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. |
| 47 | add_python_test_target(check-lldb |
| 48 | ${LLDB_SOURCE_DIR}/test/dosep.ty |
| 49 | "${LLDB_DOSEP_ARGS}" |
Daniel Malea | 0856107 | 2013-03-05 21:59:12 +0000 | [diff] [blame^] | 50 | "Testing LLDB (with a separate subprocess per test)" |
Daniel Malea | 137c4d7 | 2013-02-28 23:11:46 +0000 | [diff] [blame] | 51 | ) |