aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-03-17 08:48:03 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-24 12:46:15 -0300
commit1ee7ca7bc0739526bf07ddc0cfc9fbbd18523591 (patch)
tree751ad22670cb9b40329a84773e783ba3b8c357f3 /cmake
parent47e90ea1c5077bf64dcb729c7fc6ccaaea142c5f (diff)
downloadrneovim-1ee7ca7bc0739526bf07ddc0cfc9fbbd18523591.tar.gz
rneovim-1ee7ca7bc0739526bf07ddc0cfc9fbbd18523591.tar.bz2
rneovim-1ee7ca7bc0739526bf07ddc0cfc9fbbd18523591.zip
test: Improve functional test debuggability and efficiency
- Read TEST_TAG/TEST_FILTER env vars from cmake/RunTests.cmake. Setting these environment variables will pass --tags/--filter to busted, which can used to filter which tests are executed. - Remove calls to nvim msgpack-rpc API outside tests. This removes the requirement of having a static `clear` call in test/functional/helpers.lua - Use the new busted command-line option "--lazy" to ensure the setup/teardown hooks are only executed when a suite runs at least one test. Now its possible to run/debug a single test like this: ```sh TEST_FILTER='some test string' make test ``` Which will only run tests containing "some test string" in the title. Another option is: ```sh TEST_TAG=some-tag make test ``` After putting #some-tag into the test title. This also improves debugging experience because there will be no unnecessary gdbserver instances whe GDB=1 is passed.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/RunTests.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake
index 6262cbc383..0858ea24ac 100644
--- a/cmake/RunTests.cmake
+++ b/cmake/RunTests.cmake
@@ -17,9 +17,17 @@ if(BUSTED_OUTPUT_TYPE STREQUAL junit)
set(EXTRA_ARGS OUTPUT_FILE ${BUILD_DIR}/${TEST_TYPE}test-junit.xml)
endif()
+if(DEFINED ENV{TEST_TAG})
+ set(TEST_TAG "--tags=$ENV{TEST_TAG}")
+endif()
+
+if(DEFINED ENV{TEST_FILTER})
+ set(TEST_TAG "--filter=$ENV{TEST_FILTER}")
+endif()
+
execute_process(
- COMMAND ${BUSTED_PRG} -v -o ${BUSTED_OUTPUT_TYPE}
- --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
+ COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE}
+ --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
--lpath=${BUILD_DIR}/?.lua ${TEST_PATH}
WORKING_DIRECTORY ${WORKING_DIR}
ERROR_VARIABLE err