[libgxps] regtest: Do not consider docs with no refs as skipped
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgxps] regtest: Do not consider docs with no refs as skipped
- Date: Tue, 23 Jun 2015 17:24:56 +0000 (UTC)
commit eafb667804e0e43e2a9ef0dc6dcc4a54a9da33f2
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Tue Jun 23 18:21:59 2015 +0200
regtest: Do not consider docs with no refs as skipped
Handle them differently as new docs, and show them in the summary
suggesting to use create-refs command to include them in the test
suite.
regtest/TestRun.py | 36 ++++++++++++++++++++++--------------
1 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/regtest/TestRun.py b/regtest/TestRun.py
index c3c1938..2ac79b3 100644
--- a/regtest/TestRun.py
+++ b/regtest/TestRun.py
@@ -46,6 +46,7 @@ class TestRun:
self._crashed = []
self._failed_status_error = []
self._stderr = []
+ self._new = []
self._queue = Queue()
self._lock = RLock()
@@ -65,6 +66,7 @@ class TestRun:
ref_is_failed = self._test.is_failed(refs_path)
if not ref_has_md5 and not ref_is_crashed and not ref_is_failed:
with self._lock:
+ self._new.append(doc_path)
self._n_tests += 1
self.printer.print_default("Reference files not found, skipping '%s'" % (doc_path))
return
@@ -142,6 +144,7 @@ class TestRun:
if not os.path.isdir(refs_path):
with self._lock:
+ self._new.append(doc_path)
self._n_tests += 1
self.printer.print_default("Reference dir not found for %s, skipping" % (doc_path))
return
@@ -175,22 +178,27 @@ class TestRun:
self._queue.join()
def summary(self):
- if not self._n_run:
+ self.printer.printout_ln()
+
+ if self._n_run:
+ self.printer.printout_ln("%d tests passed (%.2f%%)" % (self._n_passed, (self._n_passed * 100.) /
self._n_run))
+ self.printer.printout_ln()
+ def report_tests(test_list, test_type):
+ n_tests = len(test_list)
+ if not n_tests:
+ return
+ self.printer.printout_ln("%d tests %s (%.2f%%): %s" % (n_tests, test_type, (n_tests * 100.)
/ self._n_run, ", ".join(test_list)))
+ self.printer.printout_ln()
+
+ report_tests(self._failed, "failed")
+ report_tests(self._crashed, "crashed")
+ report_tests(self._failed_status_error, "failed to run")
+ report_tests(self._stderr, "have stderr output")
+ else:
self.printer.printout_ln("No tests run")
- return
- self.printer.printout_ln()
- self.printer.printout_ln("%d tests passed (%.2f%%)" % (self._n_passed, (self._n_passed * 100.) /
self._n_run))
- self.printer.printout_ln()
- def report_tests(test_list, test_type):
- n_tests = len(test_list)
- if not n_tests:
- return
- self.printer.printout_ln("%d tests %s (%.2f%%): %s" % (n_tests, test_type, (n_tests * 100.) /
self._n_run, ", ".join(test_list)))
+ if self._new:
+ self.printer.printout_ln("%d new documents: %s\nUse create-refs command to add reference results
for them" % (len(self._new), ", ".join(self._new)))
self.printer.printout_ln()
- report_tests(self._failed, "failed")
- report_tests(self._crashed, "crashed")
- report_tests(self._failed_status_error, "failed to run")
- report_tests(self._stderr, "have stderr output")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]