[buildcore] Add test-verbose target

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

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)