summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorfrankf@chromium.org <frankf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-06 17:37:27 +0000
committerfrankf@chromium.org <frankf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-06 17:37:27 +0000
commitb2c3c0c0ab7d3473fe47290fdabfb1a4e83a277e (patch)
treef20c7d79d2b70f593e4a792efb77ca207890c9c5 /build
parent2196ec32406c8dea60709ae3ed73a3fffbf9c9e2 (diff)
downloadchromium_src-b2c3c0c0ab7d3473fe47290fdabfb1a4e83a277e.zip
chromium_src-b2c3c0c0ab7d3473fe47290fdabfb1a4e83a277e.tar.gz
chromium_src-b2c3c0c0ab7d3473fe47290fdabfb1a4e83a277e.tar.bz2
[Android] Create out directory for sharded perf tests during setup.
BUG= R=bulach@chromium.org Review URL: https://codereview.chromium.org/23601019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/android/pylib/constants.py1
-rw-r--r--build/android/pylib/perf/setup.py4
-rw-r--r--build/android/pylib/perf/test_runner.py9
3 files changed, 8 insertions, 6 deletions
diff --git a/build/android/pylib/constants.py b/build/android/pylib/constants.py
index ea148e7..15aebab 100644
--- a/build/android/pylib/constants.py
+++ b/build/android/pylib/constants.py
@@ -106,6 +106,7 @@ SDK_BUILD_JAVALIB_DIR = 'lib.java'
SDK_BUILD_TEST_JAVALIB_DIR = 'test.lib.java'
SDK_BUILD_APKS_DIR = 'apks'
+PERF_OUTPUT_DIR = os.path.join(DIR_SOURCE_ROOT, 'out', 'step_results')
# The directory on the device where perf test output gets saved to.
DEVICE_PERF_OUTPUT_DIR = '/data/data/' + CHROME_PACKAGE + '/files'
diff --git a/build/android/pylib/perf/setup.py b/build/android/pylib/perf/setup.py
index 5d0272d..07d1b6c 100644
--- a/build/android/pylib/perf/setup.py
+++ b/build/android/pylib/perf/setup.py
@@ -13,6 +13,7 @@ import time
from pylib import android_commands
from pylib import cmd_helper
+from pylib import constants
from pylib import forwarder
from pylib import ports
@@ -56,6 +57,9 @@ def Setup(test_options):
Returns:
A tuple of (TestRunnerFactory, tests).
"""
+ if not os.path.exists(constants.PERF_OUTPUT_DIR):
+ os.makedirs(constants.PERF_OUTPUT_DIR)
+
# Before running the tests, kill any leftover server.
_KillPendingServers()
diff --git a/build/android/pylib/perf/test_runner.py b/build/android/pylib/perf/test_runner.py
index 3b104c0..de57daf 100644
--- a/build/android/pylib/perf/test_runner.py
+++ b/build/android/pylib/perf/test_runner.py
@@ -46,16 +46,12 @@ import pexpect
import pickle
import os
import sys
-import time
from pylib import constants
from pylib.base import base_test_result
from pylib.base import base_test_runner
-_OUTPUT_DIR = os.path.join(constants.DIR_SOURCE_ROOT, 'out', 'step_results')
-
-
def PrintTestOutput(test_name):
"""Helper method to print the output of previously executed test_name.
@@ -65,7 +61,7 @@ def PrintTestOutput(test_name):
Returns:
exit code generated by the test step.
"""
- file_name = os.path.join(_OUTPUT_DIR, test_name)
+ file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name)
if not os.path.exists(file_name):
logging.error('File not found %s', file_name)
return 1
@@ -98,7 +94,8 @@ class TestRunner(base_test_runner.BaseTestRunner):
@staticmethod
def _SaveResult(result):
- with file(os.path.join(_OUTPUT_DIR, result['name']), 'w') as f:
+ with file(os.path.join(constants.PERF_OUTPUT_DIR,
+ result['name']), 'w') as f:
f.write(pickle.dumps(result))
def _LaunchPerfTest(self, test_name):