blob: 772e572bb75436c44f4f097a83136def69636608 [file] [log] [blame]
Junji Watanabe79d1c7c2019-10-21 04:46:49 +00001#!/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
6import os
7import sys
8
9import six
10
Junji Watanabe79d1c7c2019-10-21 04:46:49 +000011THIS_DIR = os.path.dirname(os.path.abspath(__file__))
12TESTS_DIR = os.path.join(THIS_DIR, 'tests')
Junji Watanabef1cb0a92019-10-25 09:39:38 +000013LUCI_DIR = os.path.dirname(THIS_DIR)
14COMPONENTS_DIR = os.path.join(LUCI_DIR, 'appengine', 'components')
Junji Watanabe79d1c7c2019-10-21 04:46:49 +000015
16def main():
17 sys.path.insert(0, TESTS_DIR)
18 import test_env
19 test_env.setup()
20
Junji Watanabef1cb0a92019-10-25 09:39:38 +000021 sys.path.insert(0, COMPONENTS_DIR)
22 from test_support import parallel_test_runner
23
Junji Watanabe79d1c7c2019-10-21 04:46:49 +000024 # Need to specify config path explicitly
25 # because test_env.setup() changes directory
Junji Watanabef1cb0a92019-10-25 09:39:38 +000026 cfg = os.path.join(COMPONENTS_DIR, 'test_support', 'unittest.cfg')
Junji Watanabe79d1c7c2019-10-21 04:46:49 +000027 sys.argv.extend(['-c', cfg])
28
29 # execute test runner
30 return parallel_test_runner.run_tests(python3=six.PY3)
31
32
33if __name__ == '__main__':
34 main()