run-tests: move SKIPPED_PREFIX and FAILED_PREFIX into TTest
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 20 Apr 2014 10:19:58 -0700
changeset 21381 9aa5784992d4
parent 21380 de6ea36ca9f7
child 21382 4b8ffe3abdd2
run-tests: move SKIPPED_PREFIX and FAILED_PREFIX into TTest
tests/run-tests.py
--- a/tests/run-tests.py	Sun Apr 20 10:16:36 2014 -0700
+++ b/tests/run-tests.py	Sun Apr 20 10:19:58 2014 -0700
@@ -92,8 +92,6 @@
 
     return p
 
-SKIPPED_PREFIX = 'skipped: '
-FAILED_PREFIX  = 'hghave check failed: '
 PYTHON = sys.executable.replace('\\', '/')
 IMPL_PATH = 'PYTHONPATH'
 if 'java' in sys.platform:
@@ -627,6 +625,9 @@
 class TTest(Test):
     """A "t test" is a test backed by a .t file."""
 
+    SKIPPED_PREFIX = 'skipped: '
+    FAILED_PREFIX = 'hghave check failed: '
+
     def _run(self, testtmp, replacements, env):
         f = open(self._path)
         lines = f.readlines()
@@ -902,12 +903,12 @@
         missing = []
         failed = []
         for line in lines:
-            if line.startswith(SKIPPED_PREFIX):
+            if line.startswith(TTest.SKIPPED_PREFIX):
                 line = line.splitlines()[0]
-                missing.append(line[len(SKIPPED_PREFIX):])
-            elif line.startswith(FAILED_PREFIX):
+                missing.append(line[len(TTest.SKIPPED_PREFIX):])
+            elif line.startswith(TTest.FAILED_PREFIX):
                 line = line.splitlines()[0]
-                failed.append(line[len(FAILED_PREFIX):])
+                failed.append(line[len(TTest.FAILED_PREFIX):])
 
         return missing, failed