[buildcore] Add test-verbose target
This commit is contained in:
parent
f4580a742e
commit
3e3cfcaf7d
4
deps/buildcore/base.mk
vendored
4
deps/buildcore/base.mk
vendored
@ -26,6 +26,7 @@ SCRIPTS=${BUILDCORE_PATH}/scripts
|
|||||||
SETUP_BUILD=${PYTHON3} ${SCRIPTS}/setup-build.py
|
SETUP_BUILD=${PYTHON3} ${SCRIPTS}/setup-build.py
|
||||||
PYBB=${PYTHON3} ${SCRIPTS}/pybb.py
|
PYBB=${PYTHON3} ${SCRIPTS}/pybb.py
|
||||||
CMAKE_BUILD=${PYBB} cmake-build
|
CMAKE_BUILD=${PYBB} cmake-build
|
||||||
|
CTEST_ALL=${PYBB} ctest-verbose
|
||||||
RM_RF=${PYBB} rm
|
RM_RF=${PYBB} rm
|
||||||
ifdef USE_VCPKG
|
ifdef USE_VCPKG
|
||||||
ifndef VCPKG_DIR_BASE
|
ifndef VCPKG_DIR_BASE
|
||||||
@ -69,6 +70,9 @@ purge:
|
|||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: build
|
test: build
|
||||||
${ENV_RUN} ${CMAKE_BUILD} build test
|
${ENV_RUN} ${CMAKE_BUILD} build test
|
||||||
|
.PHONY: test-verbose
|
||||||
|
test-verbose: build
|
||||||
|
${ENV_RUN} ${CTEST_ALL} build
|
||||||
|
|
||||||
.PHONY: devenv-image
|
.PHONY: devenv-image
|
||||||
devenv-image:
|
devenv-image:
|
||||||
|
16
deps/buildcore/scripts/pybb.py
vendored
16
deps/buildcore/scripts/pybb.py
vendored
@ -41,6 +41,19 @@ def rm(path):
|
|||||||
shutil.rmtree(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):
|
def cmake_build(base_path, target):
|
||||||
if not os.path.isdir(base_path):
|
if not os.path.isdir(base_path):
|
||||||
# nothing to build
|
# nothing to build
|
||||||
@ -60,6 +73,9 @@ def main():
|
|||||||
elif sys.argv[1] == 'rm':
|
elif sys.argv[1] == 'rm':
|
||||||
for i in range(2, len(sys.argv)):
|
for i in range(2, len(sys.argv)):
|
||||||
rm(sys.argv[i])
|
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':
|
elif sys.argv[1] == 'cmake-build':
|
||||||
err = cmake_build(sys.argv[2], sys.argv[3] if len(sys.argv) > 3 else None)
|
err = cmake_build(sys.argv[2], sys.argv[3] if len(sys.argv) > 3 else None)
|
||||||
sys.exit(err)
|
sys.exit(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user