diff --git a/deps/buildcore/base.mk b/deps/buildcore/base.mk index 685b25cd..ecc7bef8 100644 --- a/deps/buildcore/base.mk +++ b/deps/buildcore/base.mk @@ -26,6 +26,7 @@ SCRIPTS=${BUILDCORE_PATH}/scripts SETUP_BUILD=${PYTHON3} ${SCRIPTS}/setup-build.py PYBB=${PYTHON3} ${SCRIPTS}/pybb.py CMAKE_BUILD=${PYBB} cmake-build +CTEST_ALL=${PYBB} ctest-verbose RM_RF=${PYBB} rm ifdef USE_VCPKG ifndef VCPKG_DIR_BASE @@ -69,6 +70,9 @@ purge: .PHONY: test test: build ${ENV_RUN} ${CMAKE_BUILD} build test +.PHONY: test-verbose +test-verbose: build + ${ENV_RUN} ${CTEST_ALL} build .PHONY: devenv-image devenv-image: diff --git a/deps/buildcore/scripts/pybb.py b/deps/buildcore/scripts/pybb.py index 3308ff1f..fbad7490 100755 --- a/deps/buildcore/scripts/pybb.py +++ b/deps/buildcore/scripts/pybb.py @@ -41,6 +41,19 @@ def rm(path): shutil.rmtree(path) +def ctest_verbose(base_path): + if not os.path.isdir(base_path): + # nothing to build + return 0 + args = ['ctest', '--output-on-failure'] + orig_dir = os.getcwd() + for d in os.listdir(base_path): + os.chdir(os.path.join(orig_dir, base_path, d)) + err = subprocess.run(args).returncode + if err != 0: + return err + + def cmake_build(base_path, target): if not os.path.isdir(base_path): # nothing to build @@ -60,6 +73,9 @@ def main(): elif sys.argv[1] == 'rm': for i in range(2, len(sys.argv)): rm(sys.argv[i]) + elif sys.argv[1] == 'ctest-verbose': + err = ctest_verbose(sys.argv[2]) + sys.exit(err) elif sys.argv[1] == 'cmake-build': err = cmake_build(sys.argv[2], sys.argv[3] if len(sys.argv) > 3 else None) sys.exit(err)