Bug 1262102 - Part 3. Extract ICU data file on unit tests. r?jmaher
When runnig unit test such as xpcshell-test, it doesn't use APK file. So ICU data file should be extracted on GRE path.
MozReview-Commit-ID: LfWJfIPNNyk
--- a/testing/remotecppunittests.py
+++ b/testing/remotecppunittests.py
@@ -1,15 +1,16 @@
#!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os, sys
+import re
import subprocess
import tempfile
from zipfile import ZipFile
import runcppunittests as cppunittests
import mozcrash
import mozfile
import mozinfo
import mozlog
@@ -63,17 +64,17 @@ class RemoteCPPUnitTests(cppunittests.CP
szip = None
else:
szip = None
if self.options.local_apk:
with mozfile.TemporaryDirectory() as tmpdir:
apk_contents = ZipFile(self.options.local_apk)
for info in apk_contents.infolist():
- if info.filename.endswith(".so"):
+ if info.filename.endswith(".so") or re.match(r".*/icudt\d+l\.dat$", info.filename):
print >> sys.stderr, "Pushing %s.." % info.filename
remote_file = posixpath.join(self.remote_bin_dir, os.path.basename(info.filename))
apk_contents.extract(info, tmpdir)
local_file = os.path.join(tmpdir, info.filename)
if szip:
try:
out = subprocess.check_output([szip, '-d', local_file], stderr=subprocess.STDOUT)
except CalledProcessError:
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -1,16 +1,17 @@
#!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import posixpath
import sys, os
+import re
import subprocess
import runxpcshelltests as xpcshell
import tempfile
from zipfile import ZipFile
from mozlog import commandline
import shutil
import mozdevice
import mozfile
@@ -426,17 +427,17 @@ class XPCShellRemote(xpcshell.XPCShellTe
szip = None
else:
szip = None
pushed_libs_count = 0
if self.options.localAPK:
try:
dir = tempfile.mkdtemp()
for info in self.localAPKContents.infolist():
- if info.filename.endswith(".so"):
+ if info.filename.endswith(".so") or re.match(r".*/icudt\d+l\.dat$", info.filename):
print >> sys.stderr, "Pushing %s.." % info.filename
remoteFile = remoteJoin(self.remoteBinDir, os.path.basename(info.filename))
self.localAPKContents.extract(info, dir)
localFile = os.path.join(dir, info.filename)
if szip:
try:
out = subprocess.check_output([szip, '-d', localFile], stderr=subprocess.STDOUT)
except CalledProcessError: