Bug 1262102 - Part 3. Extract ICU data file on unit tests. r?jmaher draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 05 Jul 2016 17:38:02 +0900
changeset 387012 517e1645db17314c79ea5ce05eaeca9f904090a1
parent 387011 22defe47699d75f9dc065cf5b0feba058f821f1e
child 387013 d73bd703f36dcf439968c97c97e439af2df855b6
push id22886
push userbmo:m_kato@ga2.so-net.ne.jp
push dateWed, 13 Jul 2016 09:46:55 +0000
reviewersjmaher
bugs1262102
milestone50.0a1
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
testing/remotecppunittests.py
testing/xpcshell/remotexpcshelltests.py
--- 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: