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

Unified Diff: build/android/pylib/gtest/test_package_exe.py

Issue 157743004: android: Require exe unittests to have a foo_unittest_stripped target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: debug more Created 6 years, 10 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
« no previous file with comments | « build/all.gyp ('k') | sandbox/linux/sandbox_linux.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/test_package_exe.py
diff --git a/build/android/pylib/gtest/test_package_exe.py b/build/android/pylib/gtest/test_package_exe.py
index 02330f036f33c3df46e058464ed6a2d8154924bd..b73ff0f6550353fcf225101d81c7d1abf3069a3d 100644
--- a/build/android/pylib/gtest/test_package_exe.py
+++ b/build/android/pylib/gtest/test_package_exe.py
@@ -122,26 +122,21 @@ class TestPackageExecutable(TestPackage):
if self.tool.NeedsDebugInfo():
target_name = self.suite_path
else:
- target_name = self.suite_path + '_' + adb.GetDevice() + '_stripped'
- should_strip = True
- if os.path.isfile(target_name):
- logging.info('Found target file %s' % target_name)
- target_mtime = os.stat(target_name).st_mtime
- source_mtime = os.stat(self.suite_path).st_mtime
- if target_mtime > source_mtime:
- logging.info('Target mtime (%d) is newer than source (%d), assuming '
- 'no change.' % (target_mtime, source_mtime))
- should_strip = False
-
- if should_strip:
- logging.info('Did not find up-to-date stripped binary. Generating a '
- 'new one (%s).' % target_name)
- # Whenever we generate a stripped binary, copy to the symbols dir. If we
- # aren't stripping a new binary, assume it's there.
- if not os.path.exists(self._symbols_dir):
- os.makedirs(self._symbols_dir)
- shutil.copy(self.suite_path, self._symbols_dir)
- strip = os.environ['STRIP']
- cmd_helper.RunCmd([strip, self.suite_path, '-o', target_name])
+ target_name = self.suite_path + '_stripped'
+ if not os.path.isfile(target_name):
+ logging.critical('Did not find %s, build target %s',
+ target_name, self.suite_name + '_stripped')
+ sys.exit(1)
+
+ target_mtime = os.stat(target_name).st_mtime
+ source_mtime = os.stat(self.suite_path).st_mtime
+ if target_mtime < source_mtime:
+ logging.critical(
+ 'stripped binary (%s, timestamp %d) older than '
+ 'source binary (%s, timestamp %d), build target %s',
+ target_name, target_mtime, self.suite_path, source_mtime,
+ self.suite_name + '_stripped')
+ sys.exit(1)
+
test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name
adb.PushIfNeeded(target_name, test_binary)
« no previous file with comments | « build/all.gyp ('k') | sandbox/linux/sandbox_linux.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698