[buildcore] Add test-verbose target

This commit is contained in:
Gary Talent 2021-07-30 00:00:03 -05:00
parent f4580a742e
commit 3e3cfcaf7d
2 changed files with 20 additions and 0 deletions

View File

@ -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:

View File

@ -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)