build/test: skip empty TEST_TAG, TEST_FILTER

- Empty "--tags=", "--filter=" prevents TEST_FILE from running.
- Fix another bug: TEST_FILTER overwrote TEST_TAG.
This commit is contained in:
Justin M. Keyes 2018-06-16 01:45:50 +02:00
parent 2a274cbe30
commit 1cc3b32f4c
1 changed files with 3 additions and 3 deletions

View File

@ -24,12 +24,12 @@ if(BUSTED_OUTPUT_TYPE STREQUAL junit)
set(EXTRA_ARGS OUTPUT_FILE ${BUILD_DIR}/${TEST_TYPE}test-junit.xml)
endif()
if(DEFINED ENV{TEST_TAG})
if(DEFINED ENV{TEST_TAG} AND NOT "$ENV{TEST_TAG}" STREQUAL "")
set(TEST_TAG "--tags=$ENV{TEST_TAG}")
endif()
if(DEFINED ENV{TEST_FILTER})
set(TEST_TAG "--filter=$ENV{TEST_FILTER}")
if(DEFINED ENV{TEST_FILTER} AND NOT "$ENV{TEST_FILTER}" STREQUAL "")
set(TEST_FILTER "--filter=$ENV{TEST_FILTER}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${WORKING_DIR}/Xtest-tmpdir)