(not just within the rebaseline_server subdirectory)
Generally useful, but needed asap for my work on http://skbug.com/2752 ('split existing "gpu" GM results into "gl" and "gles"')
BUG=skia:677
NOTREECHECKS=True
NOTRY=True
R=rmistry@google.com
TBR=rmistry
Author: epoger@google.com
Review URL: https://codereview.chromium.org/
398043002
--- /dev/null
+# Needed so that test_all.py will recurse into this directory.
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()
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)
found in the LICENSE file.
Run all unittests within this directory tree, recursing into subdirectories.
-
-TODO(epoger): Launch this automatically on the housekeeper bot, but first make
-sure it works properly after having been checked out (from both git and svn)
"""
import os
--- /dev/null
+#!/usr/bin/python
+
+"""
+Copyright 2014 Google Inc.
+
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+
+Run all unittests within this directory tree, recursing into subdirectories.
+"""
+
+import os
+import unittest
+
+
+def main():
+ suite = unittest.TestLoader().discover(os.path.dirname(__file__),
+ pattern='*_test.py')
+ results = unittest.TextTestRunner(verbosity=2).run(suite)
+ print repr(results)
+ if not results.wasSuccessful():
+ raise Exception('failed one or more unittests')
+
+if __name__ == '__main__':
+ main()
assert_fails "python gm/display_json_results.py $GM_OUTPUTS/$CASE/$OUTPUT_EXPECTED_SUBDIR/json-summary.txt"
done
-# Exercise all rebaseline_server unittests.
-assert_passes "python gm/rebaseline_server/test_all.py"
+# Exercise all Python unittests.
+assert_passes "python gm/test_all.py"
echo
if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then