From ebe9cb42e328d05b5ad43631e4675743bd896c60 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Fri, 27 Aug 2021 12:00:17 +0200 Subject: [PATCH] Fix bootstrap with regresschecks disabled When running bootstrap with regression checks disabled but tap tests enabled, bootstrap would fail when trying to add dependencies to the installcheck target which was not defined when regression checks are off. --- test/CMakeLists.txt | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7d4e00316..22479ba8b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -73,24 +73,22 @@ elseif(REQUIRE_ALL_TESTS) "All tests were required but 'pg_isolation_regress' could not be found") endif() -if(_install_checks) - add_custom_target(installcheck DEPENDS ${_install_checks}) +# We add the installcheck target even when _install_checks is empty as tsl code +# might add dependencies to it even when regress checks are disabled. +add_custom_target(installcheck DEPENDS ${_install_checks}) - # Define a post test hook that is invoked after the installcheck target - # finishes. One can use add_dependencies on post hook target to run other - # targets after tests complete. This is used, e.g., by code coverage. - add_custom_target(installcheck-post-hook COMMENT "Post test hook") - add_custom_command( - TARGET installcheck - POST_BUILD - COMMAND cmake --build ${CMAKE_CURRENT_BINARY_DIR} --target - installcheck-post-hook) -endif() +# Define a post test hook that is invoked after the installcheck target +# finishes. One can use add_dependencies on post hook target to run other +# targets after tests complete. This is used, e.g., by code coverage. +add_custom_target(installcheck-post-hook COMMENT "Post test hook") +add_custom_command( + TARGET installcheck + POST_BUILD + COMMAND cmake --build ${CMAKE_CURRENT_BINARY_DIR} --target + installcheck-post-hook) # installchecklocal tests against an existing postgres instance -if(_local_install_checks) - add_custom_target(installchecklocal DEPENDS ${_local_install_checks}) -endif() +add_custom_target(installchecklocal DEPENDS ${_local_install_checks}) add_subdirectory(sql) add_subdirectory(isolation)