OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
| 6 # Run build_server so that files needed by tests are copied to the local |
| 7 # third_party directory. |
| 8 import build_server |
| 9 build_server.main() |
| 10 |
6 from handler import Handler | 11 from handler import Handler |
7 from local_renderer import LocalRenderer | 12 from local_renderer import LocalRenderer |
8 import optparse | 13 import optparse |
9 import os | 14 import os |
10 import sys | 15 import sys |
11 import time | 16 import time |
12 import unittest | 17 import unittest |
13 | 18 |
14 # Run build_server so that files needed by tests are copied to the local | |
15 # third_party directory. | |
16 import build_server | |
17 build_server.main() | |
18 | |
19 # Arguments set up if __main__ specifies them. | 19 # Arguments set up if __main__ specifies them. |
20 _BASE_PATH = os.path.join( | 20 _BASE_PATH = os.path.join( |
21 os.path.abspath(os.path.dirname(__file__)), os.pardir, os.pardir) | 21 os.path.abspath(os.path.dirname(__file__)), os.pardir, os.pardir) |
22 _EXPLICIT_TEST_FILES = None | 22 _EXPLICIT_TEST_FILES = None |
23 | 23 |
24 def _GetPublicFiles(): | 24 def _GetPublicFiles(): |
25 '''Gets all public files mapped to their contents. | 25 '''Gets all public files mapped to their contents. |
26 ''' | 26 ''' |
27 public_path = os.path.join(_BASE_PATH, 'docs', 'templates', 'public', '') | 27 public_path = os.path.join(_BASE_PATH, 'docs', 'templates', 'public', '') |
28 public_files = {} | 28 public_files = {} |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 parser.add_option('-p', '--path', default=None) | 100 parser.add_option('-p', '--path', default=None) |
101 parser.add_option('-a', '--all', action='store_true', default=False) | 101 parser.add_option('-a', '--all', action='store_true', default=False) |
102 (opts, args) = parser.parse_args() | 102 (opts, args) = parser.parse_args() |
103 if not opts.all: | 103 if not opts.all: |
104 _EXPLICIT_TEST_FILES = args | 104 _EXPLICIT_TEST_FILES = args |
105 if opts.path is not None: | 105 if opts.path is not None: |
106 _BASE_PATH = opts.path | 106 _BASE_PATH = opts.path |
107 # Kill sys.argv because we have our own flags. | 107 # Kill sys.argv because we have our own flags. |
108 sys.argv = [sys.argv[0]] | 108 sys.argv = [sys.argv[0]] |
109 unittest.main() | 109 unittest.main() |
OLD | NEW |