Chromium Code Reviews| Index: tools/unittests/run_perf_test.py |
| diff --git a/tools/unittests/run_perf_test.py b/tools/unittests/run_perf_test.py |
| index f3e5aff49f60988475cc45ec7da0d27b524509da..1a4d73857ab609a68cd92153069bf078cf909bf3 100644 |
| --- a/tools/unittests/run_perf_test.py |
| +++ b/tools/unittests/run_perf_test.py |
| @@ -10,7 +10,9 @@ from mock import DEFAULT |
| from mock import MagicMock |
| import os |
| from os import path, sys |
| +import platform |
| import shutil |
| +import subprocess |
| import tempfile |
| import unittest |
| @@ -129,6 +131,9 @@ class PerfTest(unittest.TestCase): |
| self.assertEquals(dirs.pop(), args[0]) |
| os.chdir = MagicMock(side_effect=chdir) |
| + subprocess.check_call = MagicMock() |
| + platform.system = MagicMock(return_value='Linux') |
| + |
| def _CallMain(self, *args): |
| self._test_output = path.join(TEST_WORKSPACE, "results.json") |
| all_args=[ |
| @@ -448,6 +453,19 @@ class PerfTest(unittest.TestCase): |
| (path.join("out-no-patch", "x64.release", "d7"), "--flag", "run.js"), |
| ) |
| + def testWrongBinaryWithProf(self): |
| + test_input = dict(V8_JSON) |
| + self._WriteTestInput(test_input) |
| + self._MockCommand(["."], ["x\nRichards: 1.234\nDeltaBlue: 10657567\ny\n"]) |
| + self.assertEquals(0, self._CallMain("--extra-flags=--prof")) |
|
Michael Achenbach
2015/09/15 07:59:01
This is all c/p - the difference in this test is t
|
| + self._VerifyResults("test", "score", [ |
| + {"name": "Richards", "results": ["1.234"], "stddev": ""}, |
| + {"name": "DeltaBlue", "results": ["10657567.0"], "stddev": ""}, |
| + ]) |
| + self._VerifyErrors([]) |
| + self._VerifyMock(path.join("out", "x64.release", "d7"), |
| + "--flag", "--prof", "run.js") |
| + |
| def testUnzip(self): |
| def Gen(): |
| for i in [1, 2, 3]: |