71 description =
"A simple script to add CTest ADD_TEST macros to a "+\
72 "file for every test in a google-test executable."
73 parser = ap.ArgumentParser(description=description)
75 executable =
'the path to the test exectuable to call'
76 parser.add_argument(
'--executable', help=executable, required=
True)
78 reg_dir =
"the regression tests directory"
79 parser.add_argument(
'--reg_dir', help=reg_dir, required=
True)
81 output =
"the file to write the ADD_TEST macros to "+\
82 "(nominally CTestTestfile.cmake)"
83 parser.add_argument(
'--output', help=output, required=
True)
85 args = parser.parse_args()
87 assert os.path.exists(args.executable)
88 assert os.path.exists(args.output)
90 rtn = subprocess.Popen([args.executable,
"--gtest_list_tests"],
91 stdout=subprocess.PIPE, shell=(os.name==
'nt'))
93 if rtn.returncode != 0:
94 raise OSError(
'Could not generate test list, return code: '
95 + str(rtn.returncode) +
'.')