Blog: 2023-08-24: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Trying to figure out how to run single test in fish Makefile: <pre> .PHONY: test test: build/fish $(CMAKE) --build build --target test </pre> Tests.cmake: <pre> # CMake b...") |
(No difference)
|
Revision as of 21:46, 23 August 2023
Trying to figure out how to run single test in fish
Makefile:
.PHONY: test test: build/fish $(CMAKE) --build build --target test
Tests.cmake:
# CMake being CMake, you can't just add a DEPENDS argument to add_test to make it depend on any of # your binaries actually being built before `make test` is executed (requiring `make all` first), # and the only dependency a test can have is on another test. So we make building fish and # `fish_tests` prerequisites to our entire top-level `test` target. function(add_test_target NAME) string(REPLACE "/" "-" NAME ${NAME}) add_custom_target("test_${NAME}" COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R "^${NAME}$$" DEPENDS fish_tests tests_buildroot_target USES_TERMINAL ) endfunction()
Aha, the -R argument.
Solution:
cmake --build build --target test_tmux-complete.fish
For a test name tmux-complete.fish.