Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 def ListTests(self, context): | 227 def ListTests(self, context): |
| 228 shell = os.path.abspath(os.path.join(context.shell_dir, self.shell())) | 228 shell = os.path.abspath(os.path.join(context.shell_dir, self.shell())) |
| 229 if utils.IsWindows(): | 229 if utils.IsWindows(): |
| 230 shell += ".exe" | 230 shell += ".exe" |
| 231 output = commands.Execute(context.command_prefix + | 231 output = commands.Execute(context.command_prefix + |
| 232 [shell, "--gtest_list_tests"] + | 232 [shell, "--gtest_list_tests"] + |
| 233 context.extra_flags) | 233 context.extra_flags) |
| 234 if output.exit_code != 0: | 234 if output.exit_code != 0: |
| 235 print output.stdout | 235 print output.stdout |
| 236 print output.stderr | 236 print output.stderr |
| 237 return [] | 237 raise Exception("Test executable failed to list the tests.") |
|
Jakob Kummerow
2014/09/26 13:49:10
You should print something to identify the suite (
| |
| 238 tests = [] | 238 tests = [] |
| 239 test_case = '' | 239 test_case = '' |
| 240 for line in output.stdout.splitlines(): | 240 for line in output.stdout.splitlines(): |
| 241 test_desc = line.strip().split()[0] | 241 test_desc = line.strip().split()[0] |
| 242 if test_desc.endswith('.'): | 242 if test_desc.endswith('.'): |
| 243 test_case = test_desc | 243 test_case = test_desc |
| 244 elif test_case and test_desc: | 244 elif test_case and test_desc: |
| 245 test = testcase.TestCase(self, test_case + test_desc, dependency=None) | 245 test = testcase.TestCase(self, test_case + test_desc, dependency=None) |
| 246 tests.append(test) | 246 tests.append(test) |
| 247 tests.sort() | 247 tests.sort() |
| 248 return tests | 248 return tests |
| 249 | 249 |
| 250 def GetFlagsForTestCase(self, testcase, context): | 250 def GetFlagsForTestCase(self, testcase, context): |
| 251 return (testcase.flags + ["--gtest_filter=" + testcase.path] + | 251 return (testcase.flags + ["--gtest_filter=" + testcase.path] + |
| 252 ["--gtest_random_seed=%s" % context.random_seed] + | 252 ["--gtest_random_seed=%s" % context.random_seed] + |
| 253 ["--gtest_print_time=0"] + | 253 ["--gtest_print_time=0"] + |
| 254 context.mode_flags) | 254 context.mode_flags) |
| 255 | 255 |
| 256 def shell(self): | 256 def shell(self): |
| 257 return self.name | 257 return self.name |
| OLD | NEW |