Namespace the embedded mutation target
This commit is contained in:
@@ -173,12 +173,19 @@ set_tests_properties(
|
|||||||
# re-runs the whole suite once per mutant, so it is a manual target rather than
|
# re-runs the whole suite once per mutant, so it is a manual target rather than
|
||||||
# a CTest test:
|
# a CTest test:
|
||||||
# cmake --build build --target mutation
|
# cmake --build build --target mutation
|
||||||
|
# When embedded in another project, use a namespaced target to avoid collisions
|
||||||
|
# with mutation targets provided by sibling dependencies.
|
||||||
# This target covers both src/stdlib.c and include/akstdlib.h. CI runs the
|
# This target covers both src/stdlib.c and include/akstdlib.h. CI runs the
|
||||||
# narrower, faster src/stdlib.c set with a --threshold gate; see
|
# narrower, faster src/stdlib.c set with a --threshold gate; see
|
||||||
# .gitea/workflows/ci.yaml.
|
# .gitea/workflows/ci.yaml.
|
||||||
find_package(Python3 COMPONENTS Interpreter)
|
find_package(Python3 COMPONENTS Interpreter)
|
||||||
if(Python3_FOUND)
|
if(Python3_FOUND)
|
||||||
add_custom_target(mutation
|
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
|
set(AKSL_MUTATION_TARGET mutation)
|
||||||
|
else()
|
||||||
|
set(AKSL_MUTATION_TARGET akstdlib_mutation)
|
||||||
|
endif()
|
||||||
|
add_custom_target(${AKSL_MUTATION_TARGET}
|
||||||
COMMAND ${Python3_EXECUTABLE}
|
COMMAND ${Python3_EXECUTABLE}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/scripts/mutation_test.py
|
${CMAKE_CURRENT_SOURCE_DIR}/scripts/mutation_test.py
|
||||||
--source-root ${CMAKE_CURRENT_SOURCE_DIR}
|
--source-root ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
|||||||
Reference in New Issue
Block a user