- Timestamp:
- 06/09/18 15:51:37 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester/tester.py
r798 r807 152 152 153 153 154 def main( main_test_filename):154 def main(): 155 155 global input_text, name_template, test_name, exe_prog, exeargs 156 156 name_template = "" … … 160 160 parser.add_argument("-val", "--valgrind", help="Use valgrind", action="store_true") 161 161 parser.add_argument("-c", "--nocolor", help="Don't use color output", action="store_true") 162 parser.add_argument("-f", "--file", help="File name with tests , default is '" + main_test_filename + "'")162 parser.add_argument("-f", "--file", help="File name with tests", required=True) 163 163 parser.add_argument("-tp", "--tests-path", help="tests directory, files containing test definitions, inputs and outputs are relative to this directory, default is '" + globals.THISDIR + "'") 164 164 parser.add_argument("-fp", "--files-path", help="files directory, files tested by OUTFILECOMPARE are referenced relative to this directory, default is '" + globals.FILESDIR + "'") … … 168 168 parser.add_argument("-ds", "--diffslashes", help="Discriminate between slashes (consider / and \\ different)", action="store_true") 169 169 parser.add_argument("-err", "--always-show-stderr", help="Always print stderr (by default it is hidden if 0 errors in valgrind)", action="store_true") 170 parser.add_argument("-e", "--exe", help="Regexp 'search=replace' rule(s) transforming executable name(s) into paths (eg. '(.*)=path/to/\\1.exe')", action='append') #in the exaxmple, double backslash is just for printing170 parser.add_argument("-e", "--exe", help="Regexp 'search=replace' rule(s) transforming executable name(s) into paths (eg. '(.*)=path/to/\\1.exe')", action='append') # in the example, double backslash is just for printing 171 171 parser.add_argument("-p", "--platform", help="Override platform identifier (referencing platform specific files " + globals.SPEC_INSERTPLATFORMDEPENDENTFILE + "), default:sys.platform (win32,linux2)") 172 172 args = parser.parse_args() … … 178 178 main_test_filename = args.file 179 179 if args.tests_path: 180 globals.THISDIR =args.tests_path180 globals.THISDIR = args.tests_path 181 181 if args.files_path: 182 globals.FILESDIR =args.files_path182 globals.FILESDIR = args.files_path 183 183 if args.working_path: 184 globals.EXEDIR =args.working_path184 globals.EXEDIR = args.working_path 185 185 if args.name: 186 186 name_template = args.name … … 196 196 globals.init_colors(args) 197 197 198 fin = open(os.path.join(globals.THISDIR, main_test_filename))198 fin = open(os.path.join(globals.THISDIR, args.file)) 199 199 reset_values() 200 exe_prog = "default" # no longer in reset_values (exe: persists across tests)200 exe_prog = "default" # no longer in reset_values (exe: persists across tests) 201 201 outfile = [] 202 202 tests_failed = 0 … … 255 255 256 256 if __name__ == "__main__": 257 tests_failed, tests_total = main( "testy.txt")257 tests_failed, tests_total = main() 258 258 print("%d / %d failed tests" % (tests_failed, tests_total)) 259 259 sys.exit(tests_failed) # return the number of failed tests as exit code ("error level") to shell
Note: See TracChangeset
for help on using the changeset viewer.