| 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 import re | 5 import re |
| 6 from recipe_engine.types import freeze | 6 from recipe_engine.types import freeze |
| 7 | 7 |
| 8 | 8 |
| 9 TEST_CONFIGS = freeze({ | 9 TEST_CONFIGS = freeze({ |
| 10 'benchmarks': { | 10 'benchmarks': { |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 'GCMole %s' % arch, | 452 'GCMole %s' % arch, |
| 453 ['lua', self.api.path.join('tools', 'gcmole', 'gcmole.lua'), arch], | 453 ['lua', self.api.path.join('tools', 'gcmole', 'gcmole.lua'), arch], |
| 454 cwd=self.api.path['checkout'], | 454 cwd=self.api.path['checkout'], |
| 455 env=env, | 455 env=env, |
| 456 ) | 456 ) |
| 457 return TestResults.empty() | 457 return TestResults.empty() |
| 458 | 458 |
| 459 | 459 |
| 460 class V8SimpleLeakCheck(BaseTest): | 460 class V8SimpleLeakCheck(BaseTest): |
| 461 def run(self, **kwargs): | 461 def run(self, **kwargs): |
| 462 # TODO(machenbach): Add task kill step for windows. | |
| 463 relative_d8_path = self.api.path.join( | 462 relative_d8_path = self.api.path.join( |
| 464 self.api.path.basename(self.api.chromium.c.build_dir), | 463 self.api.path.basename(self.api.chromium.c.build_dir), |
| 465 self.api.chromium.c.build_config_fs, | 464 self.api.chromium.c.build_config_fs, |
| 466 'd8') | 465 'd8') |
| 467 step_result = self.api.step( | 466 tool = self.api.path['checkout'].join('tools', 'run-valgrind.py') |
| 467 step_result = self.api.python( |
| 468 'Simple Leak Check', | 468 'Simple Leak Check', |
| 469 ['valgrind', '--leak-check=full', '--show-reachable=yes', | 469 tool, |
| 470 '--num-callers=20', relative_d8_path, '-e', '"print(1+2)"'], | 470 [relative_d8_path, '-e', 'print(1+2)'], |
| 471 cwd=self.api.path['checkout'], | 471 cwd=self.api.path['checkout'], |
| 472 stderr=self.api.raw_io.output(), | |
| 473 step_test_data=lambda: self.api.raw_io.test_api.stream_output( | |
| 474 'tons of leaks', stream='stderr') | |
| 475 ) | 472 ) |
| 476 step_result.presentation.logs['stderr'] = step_result.stderr.splitlines() | |
| 477 if not 'no leaks are possible' in (step_result.stderr): | |
| 478 step_result.presentation.status = self.api.step.FAILURE | |
| 479 raise self.api.step.StepFailure('Failed leak check') | |
| 480 return TestResults.empty() | 473 return TestResults.empty() |
| 481 | 474 |
| 482 | 475 |
| 483 V8_NON_STANDARD_TESTS = freeze({ | 476 V8_NON_STANDARD_TESTS = freeze({ |
| 484 'deopt': V8DeoptFuzzer, | 477 'deopt': V8DeoptFuzzer, |
| 485 'fuzz': V8Fuzzer, | 478 'fuzz': V8Fuzzer, |
| 486 'gcmole': V8GCMole, | 479 'gcmole': V8GCMole, |
| 487 'presubmit': V8Presubmit, | 480 'presubmit': V8Presubmit, |
| 488 'simpleleak': V8SimpleLeakCheck, | 481 'simpleleak': V8SimpleLeakCheck, |
| 489 }) | 482 }) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 # TODO(machenbach): Implement swarming for non-standard tests. | 534 # TODO(machenbach): Implement swarming for non-standard tests. |
| 542 if v8_api.bot_config.get('enable_swarming') and test_step_config.swarming: | 535 if v8_api.bot_config.get('enable_swarming') and test_step_config.swarming: |
| 543 tools_mapping = TOOL_TO_TEST_SWARMING | 536 tools_mapping = TOOL_TO_TEST_SWARMING |
| 544 else: | 537 else: |
| 545 tools_mapping = TOOL_TO_TEST | 538 tools_mapping = TOOL_TO_TEST |
| 546 | 539 |
| 547 # The tool the test is going to use. Default: V8 test runner (run-tests). | 540 # The tool the test is going to use. Default: V8 test runner (run-tests). |
| 548 tool = TEST_CONFIGS[test_step_config.name].get('tool', 'run-tests') | 541 tool = TEST_CONFIGS[test_step_config.name].get('tool', 'run-tests') |
| 549 test_cls = tools_mapping[tool] | 542 test_cls = tools_mapping[tool] |
| 550 return test_cls(test_step_config, api, v8_api) | 543 return test_cls(test_step_config, api, v8_api) |
| OLD | NEW |