Junji Watanabe | 79d1c7c | 2019-10-21 04:46:49 +0000 | [diff] [blame] | 1 | #!/usr/bin/env vpython |
| 2 | # Copyright 2019 The LUCI Authors. All rights reserved. |
| 3 | # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 | # that can be found in the LICENSE file. |
| 5 | |
| 6 | import os |
| 7 | import sys |
| 8 | |
| 9 | import six |
| 10 | |
| 11 | from test_support import parallel_test_runner |
| 12 | |
| 13 | THIS_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 14 | TESTS_DIR = os.path.join(THIS_DIR, 'tests') |
| 15 | |
| 16 | def main(): |
| 17 | sys.path.insert(0, TESTS_DIR) |
| 18 | import test_env |
| 19 | test_env.setup() |
| 20 | |
| 21 | # Need to specify config path explicitly |
| 22 | # because test_env.setup() changes directory |
| 23 | cfg = os.path.join(THIS_DIR, 'unittest.cfg') |
| 24 | sys.argv.extend(['-c', cfg]) |
| 25 | |
| 26 | # execute test runner |
| 27 | return parallel_test_runner.run_tests(python3=six.PY3) |
| 28 | |
| 29 | |
| 30 | if __name__ == '__main__': |
| 31 | main() |