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

Unified Diff: build/android/pylib/instrumentation/test_jar.py

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « build/android/pylib/gtest/test_runner.py ('k') | build/android/pylib/instrumentation/test_result.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/test_jar.py
diff --git a/build/android/pylib/instrumentation/test_jar.py b/build/android/pylib/instrumentation/test_jar.py
index c81258f8aebecf6f8f5846ee8a2c9d0b80169823..d83d00a150e3178f29f4818eb9610b133798520c 100644
--- a/build/android/pylib/instrumentation/test_jar.py
+++ b/build/android/pylib/instrumentation/test_jar.py
@@ -23,7 +23,7 @@ sys.path.insert(0,
import unittest_util # pylint: disable=F0401
# If you change the cached output of proguard, increment this number
-PICKLE_FORMAT_VERSION = 2
+PICKLE_FORMAT_VERSION = 3
class TestJar(object):
@@ -55,6 +55,16 @@ class TestJar(object):
if not self._GetCachedProguardData():
self._GetProguardData()
+ @staticmethod
+ def _CalculateMd5(path):
+ # TODO(jbudorick): Move MD5sum calculations out of here and
+ # AndroidCommands to their own module.
+ out = cmd_helper.GetCmdOutput(
+ [os.path.join(constants.GetOutDirectory(),
+ 'md5sum_bin_host'),
+ path])
+ return out
+
def _GetCachedProguardData(self):
if (os.path.exists(self._pickled_proguard_name) and
(os.path.getmtime(self._pickled_proguard_name) >
@@ -64,7 +74,9 @@ class TestJar(object):
try:
with open(self._pickled_proguard_name, 'r') as r:
d = pickle.loads(r.read())
- if d['VERSION'] == PICKLE_FORMAT_VERSION:
+ jar_md5 = self._CalculateMd5(self._jar_path)
+ if (d['JAR_MD5SUM'] == jar_md5 and
+ d['VERSION'] == PICKLE_FORMAT_VERSION):
self._test_methods = d['TEST_METHODS']
return True
except:
@@ -182,7 +194,8 @@ class TestJar(object):
logging.info('Storing proguard output to %s', self._pickled_proguard_name)
d = {'VERSION': PICKLE_FORMAT_VERSION,
- 'TEST_METHODS': self._test_methods}
+ 'TEST_METHODS': self._test_methods,
+ 'JAR_MD5SUM': self._CalculateMd5(self._jar_path)}
with open(self._pickled_proguard_name, 'w') as f:
f.write(pickle.dumps(d))
« no previous file with comments | « build/android/pylib/gtest/test_runner.py ('k') | build/android/pylib/instrumentation/test_result.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698