OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Run specific test on specific environment.""" | 5 """Run specific test on specific environment.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import tempfile | 9 import tempfile |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 for t in tests: | 33 for t in tests: |
34 test_name = '%s#%s' % (t['class'], t['method']) | 34 test_name = '%s#%s' % (t['class'], t['method']) |
35 logging.debug(' %s', test_name) | 35 logging.debug(' %s', test_name) |
36 test_list_file.write('%s\n' % test_name) | 36 test_list_file.write('%s\n' % test_name) |
37 test_list_file.flush() | 37 test_list_file.flush() |
38 self._test_instance._data_deps.append( | 38 self._test_instance._data_deps.append( |
39 (os.path.abspath(test_list_file.name), None)) | 39 (os.path.abspath(test_list_file.name), None)) |
40 | 40 |
41 env_vars = self._test_instance.GetDriverEnvironmentVars( | 41 env_vars = self._test_instance.GetDriverEnvironmentVars( |
42 test_list_file_path=test_list_file.name) | 42 test_list_file_path=test_list_file.name) |
43 env_vars.update(self._test_instance.GetHttpServerEnvironmentVars()) | |
44 | 43 |
45 logging.debug('extras:') | 44 logging.debug('extras:') |
46 for k, v in env_vars.iteritems(): | 45 for k, v in env_vars.iteritems(): |
47 logging.debug(' %s: %s', k, v) | 46 logging.debug(' %s: %s', k, v) |
48 | 47 |
49 self._AmInstrumentTestSetup( | 48 self._AmInstrumentTestSetup( |
50 self._test_instance.apk_under_test, | 49 self._test_instance.apk_under_test, |
51 self._test_instance.driver_apk, | 50 self._test_instance.driver_apk, |
52 self._test_instance.driver_name, | 51 self._test_instance.driver_name, |
53 environment_variables=env_vars, | 52 environment_variables=env_vars, |
(...skipping 12 matching lines...) Expand all Loading... |
66 | 65 |
67 if isinstance(result, base_test_result.BaseTestResult): | 66 if isinstance(result, base_test_result.BaseTestResult): |
68 r.AddResult(result) | 67 r.AddResult(result) |
69 elif isinstance(result, list): | 68 elif isinstance(result, list): |
70 r.AddResults(result) | 69 r.AddResults(result) |
71 else: | 70 else: |
72 raise Exception('Unexpected result type: %s' % type(result).__name__) | 71 raise Exception('Unexpected result type: %s' % type(result).__name__) |
73 | 72 |
74 self._DetectPlatformErrors(r) | 73 self._DetectPlatformErrors(r) |
75 return r | 74 return r |
OLD | NEW |