def run(self, options): config = Config() config.keep_results = options['keep_results'] config.create_diffs = options['create_diffs'] config.update_refs = options['update_refs'] t = Timer() docs = options['tests'] docs_dir = options['docs_dir'] if len(docs) == 1: if os.path.isdir(docs[0]): if docs_dir is None: docs_dir = docs[0] if docs_dir == docs[0]: docs = [] else: if docs_dir is None: docs_dir = os.path.dirname(docs[0]) else: if docs_dir is None: docs_dir = os.path.commonprefix(docs).rpartition(os.path.sep)[0] tests = TestRun(docs_dir, options['refs_dir'], options['out_dir']) status = tests.run_tests(docs) tests.summary() get_printer().printout_ln("Tests run in %s" % (t.elapsed_str())) return status
def run(self, options): config = Config() config.keep_results = options['keep_results'] config.create_diffs = options['create_diffs'] t = Timer() doc = options['tests'] if os.path.isdir(doc): docs_dir = doc else: docs_dir = os.path.dirname(doc) tests = TestRun(docs_dir, options['refs_dir'], options['out_dir']) if doc == docs_dir: tests.run_tests() else: tests.run_test(os.path.basename(doc)) tests.summary() print("Tests run in %s" % (t.elapsed_str()))