Skip to content

Instantly share code, notes, and snippets.

@GMNGeoffrey
Last active February 11, 2021 23:32
Show Gist options
  • Save GMNGeoffrey/21ea35f89495921adc877d4980589651 to your computer and use it in GitHub Desktop.
Save GMNGeoffrey/21ea35f89495921adc877d4980589651 to your computer and use it in GitHub Desktop.
ctest with directory specification
#!/usr/bin/python3
# Copyright 2021 Google LLC.
# SPDX-License-Identifier: Apache-2.0
#!/usr/bin/python3
import argparse
import subprocess
import sys
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-B",
dest="directory",
help="Directory from which to invoke ctest")
args, unknown = parser.parse_known_args()
process = subprocess.run(["ctest"] + unknown, cwd=args.directory)
sys.exit(process.returncode)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment