summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-10 02:18:13 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-10 02:18:13 +0000
commit100df2922cb1259fd948e79d702cc2b7748eb824 (patch)
treec5b63ce4b002c401dab60d615f1e337a619fdf2e
parente666228d174da3633cefb379b6cdfdb62351c846 (diff)
downloadchromium_src-100df2922cb1259fd948e79d702cc2b7748eb824.zip
chromium_src-100df2922cb1259fd948e79d702cc2b7748eb824.tar.gz
chromium_src-100df2922cb1259fd948e79d702cc2b7748eb824.tar.bz2
android: Require exe unittests to have a foo_unittest_stripped target.
This allows the test runner to not depend on the STRIP env var, which is going away. Other approaches considered: 1. Converting the remaining exe-based tests to apk tests. The apk versions were slower, and didn't pass without other changes though. 2. Just don't strip. But that slows down these two tests by over 100% (due to copying data to the device is slow, and stripped size is 0.5MB while unstripped size is on the order of 10MB). 3. Try to get a trip binary from third_party/android_tools/ndk. That's fiddly since it requires getting the right arch. Since there are only two exe-based tests left, just strip them from gyp. Medium-term, maybe gyp/mac's postbuild stuff can be brought to android, it looks like there are various things that could be made simpler with that. BUG=142642 TEST= build/android/test_runner.py gtest -s sandbox_linux_unittests && build/android/test_runner.py gtest -s breakpad_unittests R=bulach@chromium.org, frankf@chromium.org TBR=jln, thestig Review URL: https://codereview.chromium.org/157743004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250035 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--breakpad/breakpad.gyp15
-rw-r--r--build/all.gyp4
-rw-r--r--build/android/pylib/gtest/test_package_exe.py37
-rw-r--r--sandbox/linux/sandbox_linux.gypi15
4 files changed, 48 insertions, 23 deletions
diff --git a/breakpad/breakpad.gyp b/breakpad/breakpad.gyp
index 7d0a2e9..fed737e 100644
--- a/breakpad/breakpad.gyp
+++ b/breakpad/breakpad.gyp
@@ -855,5 +855,20 @@
}
],
}],
+ ['OS=="android"', {
+ 'targets': [
+ {
+ 'target_name': 'breakpad_unittests_stripped',
+ 'type': 'none',
+ 'dependencies': [ 'breakpad_unittests' ],
+ 'actions': [{
+ 'action_name': 'strip breakpad_unittests',
+ 'inputs': [ '<(PRODUCT_DIR)/breakpad_unittests' ],
+ 'outputs': [ '<(PRODUCT_DIR)/breakpad_unittests_stripped' ],
+ 'action': [ '<(android_strip)', '<@(_inputs)', '-o', '<@(_outputs)' ],
+ }],
+ }
+ ],
+ }],
],
}
diff --git a/build/all.gyp b/build/all.gyp
index 0acdfe6..893d13f 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -719,7 +719,7 @@
'../android_webview/android_webview.gyp:android_webview_unittests',
'../base/android/jni_generator/jni_generator.gyp:jni_generator_tests',
'../base/base.gyp:base_unittests',
- '../breakpad/breakpad.gyp:breakpad_unittests',
+ '../breakpad/breakpad.gyp:breakpad_unittests_stripped',
# Also compile the tools needed to deal with minidumps, they are
# needed to run minidump tests upstream.
'../breakpad/breakpad.gyp:dump_syms#host',
@@ -742,7 +742,7 @@
'../media/media.gyp:media_perftests_apk',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
- '../sandbox/sandbox.gyp:sandbox_linux_unittests',
+ '../sandbox/sandbox.gyp:sandbox_linux_unittests_stripped',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/WebKit/public/all.gyp:*',
diff --git a/build/android/pylib/gtest/test_package_exe.py b/build/android/pylib/gtest/test_package_exe.py
index 02330f0..b73ff0f 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)
diff --git a/sandbox/linux/sandbox_linux.gypi b/sandbox/linux/sandbox_linux.gypi
index 77a066a..21c0401 100644
--- a/sandbox/linux/sandbox_linux.gypi
+++ b/sandbox/linux/sandbox_linux.gypi
@@ -253,6 +253,21 @@
},
],
'conditions': [
+ [ 'OS=="android"', {
+ 'targets': [
+ {
+ 'target_name': 'sandbox_linux_unittests_stripped',
+ 'type': 'none',
+ 'dependencies': [ 'sandbox_linux_unittests' ],
+ 'actions': [{
+ 'action_name': 'strip sandbox_linux_unittests',
+ 'inputs': [ '<(PRODUCT_DIR)/sandbox_linux_unittests' ],
+ 'outputs': [ '<(PRODUCT_DIR)/sandbox_linux_unittests_stripped' ],
+ 'action': [ '<(android_strip)', '<@(_inputs)', '-o', '<@(_outputs)' ],
+ }],
+ }
+ ],
+ }],
# Strategy copied from base_unittests_apk in base/base.gyp.
[ 'OS=="android" and gtest_target_type == "shared_library"', {
'targets': [