| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from mopy import test_util | 10 from mopy import test_util |
| 11 from mopy.print_process_error import print_process_error | 11 from mopy.print_process_error import print_process_error |
| 12 | 12 |
| 13 | 13 |
| 14 _logger = logging.getLogger() | 14 _logger = logging.getLogger() |
| 15 | 15 |
| 16 | 16 |
| 17 def set_color(): | 17 def set_color(): |
| 18 """Run gtests with color if we're on a TTY (and we're not being told | 18 """Run gtests with color if we're on a TTY (and we're not being told |
| 19 explicitly what to do).""" | 19 explicitly what to do).""" |
| 20 if sys.stdout.isatty() and "GTEST_COLOR" not in os.environ: | 20 if sys.stdout.isatty() and "GTEST_COLOR" not in os.environ: |
| 21 _logger.debug("Setting GTEST_COLOR=yes") | 21 _logger.debug("Setting GTEST_COLOR=yes") |
| 22 os.environ["GTEST_COLOR"] = "yes" | 22 os.environ["GTEST_COLOR"] = "yes" |
| 23 | 23 |
| 24 # TODO(vtl): The return value is bizarre. Should just make it either return | 24 # TODO(vtl): The return value is bizarre. Should just make it either return |
| 25 # True/False, or a list of failing fixtures. But the dart_apptest runner would | 25 # True/False, or a list of failing fixtures. |
| 26 # also need to be updated in the same way. | |
| 27 def run_fixtures(config, shell, apptest_dict, apptest, isolate, test_args, | 26 def run_fixtures(config, shell, apptest_dict, apptest, isolate, test_args, |
| 28 shell_args): | 27 shell_args): |
| 29 """Run the gtest fixtures in isolation.""" | 28 """Run the gtest fixtures in isolation.""" |
| 30 | 29 |
| 31 if not isolate: | 30 if not isolate: |
| 32 if not RunApptestInShell(config, shell, apptest, test_args, shell_args): | 31 if not RunApptestInShell(config, shell, apptest, test_args, shell_args): |
| 33 return "Failed test(s) in %r" % apptest_dict | 32 return "Failed test(s) in %r" % apptest_dict |
| 34 return "Succeeded" | 33 return "Succeeded" |
| 35 | 34 |
| 36 # List the apptest fixtures so they can be run independently for isolation. | 35 # List the apptest fixtures so they can be run independently for isolation. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if line[0] != " ": | 122 if line[0] != " ": |
| 124 suite = line.strip() | 123 suite = line.strip() |
| 125 continue | 124 continue |
| 126 test_list.append(suite + line.strip()) | 125 test_list.append(suite + line.strip()) |
| 127 | 126 |
| 128 return test_list | 127 return test_list |
| 129 | 128 |
| 130 | 129 |
| 131 def RunApptestInShell(config, shell, application, application_args, shell_args): | 130 def RunApptestInShell(config, shell, application, application_args, shell_args): |
| 132 return run_test(config, shell, shell_args, {application: application_args}) | 131 return run_test(config, shell, shell_args, {application: application_args}) |
| OLD | NEW |