Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: gm/rebaseline_server/base_unittest.py

Issue 398043002: make gm self-tests launch python unittests automatically (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: whoops, forgot some files Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/rebaseline_server/__init__.py ('k') | gm/rebaseline_server/test_all.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/base_unittest.py
diff --git a/gm/rebaseline_server/base_unittest.py b/gm/rebaseline_server/base_unittest.py
index 0699db65d0af8e754b650b2f1e08dc9dd71787bc..32b4bb9d74f9f69e972ba0904abc9b070dc634b2 100755
--- a/gm/rebaseline_server/base_unittest.py
+++ b/gm/rebaseline_server/base_unittest.py
@@ -26,9 +26,14 @@ OUTPUT_DIR_EXPECTED = os.path.join(TESTDATA_DIR, 'outputs', 'expected')
class TestCase(unittest.TestCase):
def setUp(self):
+ # Get the name of this test, in such a way that it will be consistent
+ # regardless of the directory it is run from (throw away package names,
+ # if any).
+ test_name = '.'.join(self.id().split('.')[-3:])
+
self._input_dir = os.path.join(TESTDATA_DIR, 'inputs')
- self._output_dir_actual = os.path.join(OUTPUT_DIR_ACTUAL, self.id())
- self._output_dir_expected = os.path.join(OUTPUT_DIR_EXPECTED, self.id())
+ self._output_dir_actual = os.path.join(OUTPUT_DIR_ACTUAL, test_name)
+ self._output_dir_expected = os.path.join(OUTPUT_DIR_EXPECTED, test_name)
create_empty_dir(self._output_dir_actual)
self._temp_dir = tempfile.mkdtemp()
@@ -125,4 +130,4 @@ def find_different_files(dir1, dir2, ignore_subtree_names=None):
def main(test_case_class):
"""Run the unit tests within the given class."""
suite = unittest.TestLoader().loadTestsFromTestCase(test_case_class)
- results = unittest.TextTestRunner(verbosity=2).run(suite)
+ unittest.TextTestRunner(verbosity=2).run(suite)
« no previous file with comments | « gm/rebaseline_server/__init__.py ('k') | gm/rebaseline_server/test_all.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698