def command(self): cmd = [sys.executable] # # PYTHON FLAGS # # -u : force the stdout and stderr streams to be unbuffered; same as PYTHONUNBUFFERED=1 # With buffering we may end up losing output in case of crashes! (in Python 3.7 the text layer of the # streams is unbuffered, but we assume 3.6) cmd += ['-u'] # if sys.flags.verbose: cmd += ["-v"] # cmd += [self.path_to_script] # # SCRIPT FLAGS # # If the script has a custom-arguments flag, then we don't pass any of the standard options if 'custom-args' not in self.config.flags: # if log.is_debug_on(): cmd += ['--debug'] # if log.is_color_on(): cmd += ['--color'] # if self.config.context: cmd += ['--context', self.config.context] return cmd
def test_wrapper(test, configuration=None, repetition=1): global n_tests, rslog n_tests += 1 # if not log.is_debug_on() or log.is_color_on(): log.progress( configuration_str(configuration, repetition, suffix=' ') + test.name, '...') # log_path = test.get_log() # opts = set() if rslog: opts.add('--rslog') try: test.run_test(configuration=configuration, log_path=log_path, opts=opts) except FileNotFoundError as e: log.e( log.red + test.name + log.reset + ':', str(e) + configuration_str(configuration, repetition, prefix=' ')) except subprocess.TimeoutExpired: log.e( log.red + test.name + log.reset + ':', configuration_str(configuration, repetition, suffix=' ') + 'timed out') except subprocess.CalledProcessError as cpe: if not check_log_for_fails(log_path, test.name, configuration, repetition): # An unexpected error occurred log.e( log.red + test.name + log.reset + ':', configuration_str(configuration, repetition, suffix=' ') + 'exited with non-zero value (' + str(cpe.returncode) + ')')
def test_wrapper( test, configuration = None ): global n_tests n_tests += 1 if not log.is_debug_on() or log.is_color_on(): if configuration: log.progress( '[' + ' '.join( configuration ) + ']', test.name, '...' ) else: log.progress( test.name, '...' ) test.run_test()
def command(self): cmd = [self.exe] if 'custom-args' not in self.config.flags: # Assume we're a Catch2 exe, so: # if sys.flags.verbose: # cmd += if log.is_debug_on(): cmd += ['-d', 'yes'] # show durations for each test-case # cmd += ['--success'] # show successful assertions in output # if log.is_color_on(): # cmd += ['--use-colour', 'yes'] return cmd
def command(self): cmd = [sys.executable] # The unit-tests should only find module we've specifically added -- but Python may have site packages # that are automatically made available. We want to avoid those: # -S : don't imply 'import site' on initialization # NOTE: exit() is defined in site.py and works only if the site module is imported! cmd += ['-S'] if sys.flags.verbose: cmd += ["-v"] cmd += [self.path_to_script] if log.is_debug_on(): cmd += ['--debug'] if log.is_color_on(): cmd += ['--color'] return cmd
def command( self ): cmd = [sys.executable] # The unit-tests should only find module we've specifically added -- but Python may have site packages # that are automatically made available. We want to avoid those: # -S : don't imply 'import site' on initialization # NOTE: exit() is defined in site.py and works only if the site module is imported! cmd += ['-S'] # -u : force the stdout and stderr streams to be unbuffered; same as PYTHONUNBUFFERED=1 # With buffering we may end up losing output in case of crashes! (in Python 3.7 the text layer of the # streams is unbuffered, but we assume 3.6) cmd += ['-u'] if sys.flags.verbose: cmd += ["-v"] cmd += [self.path_to_script] if 'custom-args' not in self.config.flags: if log.is_debug_on(): cmd += ['--debug'] if log.is_color_on(): cmd += ['--color'] if self.config.context: cmd += ['--context', self.config.context] return cmd