commit-bot@chromium.org | f679e2b | 2014-02-19 15:38:13 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | """ |
| 4 | Copyright 2014 Google Inc. |
| 5 | |
| 6 | Use of this source code is governed by a BSD-style license that can be |
| 7 | found in the LICENSE file. |
| 8 | |
| 9 | A wrapper around the standard Python unittest library, adding features we need |
| 10 | for various unittests within this directory. |
| 11 | """ |
| 12 | |
epoger | 66ed8dc | 2014-07-17 12:54:16 -0700 | [diff] [blame^] | 13 | # System-level imports. |
commit-bot@chromium.org | f679e2b | 2014-02-19 15:38:13 +0000 | [diff] [blame] | 14 | import os |
epoger | 66ed8dc | 2014-07-17 12:54:16 -0700 | [diff] [blame^] | 15 | import sys |
commit-bot@chromium.org | f679e2b | 2014-02-19 15:38:13 +0000 | [diff] [blame] | 16 | |
epoger | 66ed8dc | 2014-07-17 12:54:16 -0700 | [diff] [blame^] | 17 | PARENT_DIR = os.path.abspath(os.path.dirname(__file__)) |
| 18 | TRUNK_DIR = os.path.abspath(os.path.join(PARENT_DIR, os.pardir, os.pardir)) |
| 19 | |
| 20 | # Import the superclass base_unittest module from the tools dir. |
| 21 | TOOLS_DIR = os.path.join(TRUNK_DIR, 'tools') |
| 22 | if TOOLS_DIR not in sys.path: |
| 23 | sys.path.append(TOOLS_DIR) |
| 24 | import tests.base_unittest as superclass_module |
commit-bot@chromium.org | f679e2b | 2014-02-19 15:38:13 +0000 | [diff] [blame] | 25 | |
| 26 | |
epoger | 66ed8dc | 2014-07-17 12:54:16 -0700 | [diff] [blame^] | 27 | class TestCase(superclass_module.TestCase): |
commit-bot@chromium.org | f679e2b | 2014-02-19 15:38:13 +0000 | [diff] [blame] | 28 | |
epoger | 66ed8dc | 2014-07-17 12:54:16 -0700 | [diff] [blame^] | 29 | def __init__(self, *args, **kwargs): |
| 30 | super(TestCase, self).__init__(*args, **kwargs) |
| 31 | # Some of the tests within this package want their output validated, |
| 32 | # so we declare where the expected and actual output will be. |
| 33 | self._testdata_dir = os.path.join(PARENT_DIR, 'testdata') |
epoger | 33ac950 | 2014-07-16 08:28:23 -0700 | [diff] [blame] | 34 | |
epoger | 66ed8dc | 2014-07-17 12:54:16 -0700 | [diff] [blame^] | 35 | def main(*args, **kwargs): |
| 36 | superclass_module.main(*args, **kwargs) |