Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: tools/unittests/run_perf_test.py

Issue 1341213002: [test] More robust perf runner with profiler option. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tools/run_perf.py ('K') | « tools/run_perf.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]:
« tools/run_perf.py ('K') | « tools/run_perf.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698