I have a CMake-based C++ project that I need to integrate into a CI/CD pipeline. The pipeline has two steps, one for building, the other for testing. Creating this environment in a Docker container works like a charm, but results in a 2GB container. So I am trying to implement a multi-stage Docker build where I copy the executables into an Alpine base image. All that works, except for the cmake/ctest functionality. I want to expose the command "make test" which will execute the CMake generate target.
This is the target that CMake has created for running ctest.
# Targets provided globally by CMake.
# Special rule for the target test
test:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
/usr/bin/ctest --force-new-ctest-process $(ARGS)
.PHONY : test
The problem I can't figure out is where ctest gets the test configuration from. When I issue
ctest -N
in the container it shows no tests.
Looking for an SME on CMake to educate me how this is supposed to work.