Closed Bug 545867 Opened 12 years ago Closed 12 years ago
.py to mozilla-central
this is to add a remotexpcshelltests.py file which is a subclass of runxpcshelltests.py.
Assignee: nobody → jmaher
initial WIP file that needs cleanup and ability for copying over xpcshell data files to the phone.
add remote xpcshell to the tree. This will copy over all the necessary test bits to the device as well.
Comment on attachment 430476 [details] [diff] [review] add file remotexpcshelltests.py to tree for running on winmo (1) >diff --git a/testing/xpcshell/remotexpcshelltests.py b/testing/xpcshell/remotexpcshelltests.py >new file mode 100644 >+# The Original Code is mozilla.org code. >+# >+# The Initial Developer of the Original Code is The Mozilla Foundation >+# Portions created by the Initial Developer are Copyright (C) 2009 >+# the Initial Developer. All Rights Reserved. Change the copyright to 2010 please. >+ >+ #todo: figure out the remote version of this, only used for debuggerInfo >+ def getcwd(self): >+ return "/tests/" That's probably worth a follow-on bug >+ >+ #todo: make a remote version of this and ensure 'manifest' is remote name I've read and read this code below, and it seems like you're creating a manifest for the device here by reading the one for the local system and changing the paths to point to the correct places on the device. I think that's fine. What is left todo? >+ def readManifest(self, manifest): >+ """Given a manifest file containing a list of test directories, >+ return a list of absolute paths to the directories contained within.""" >+ >+ manifestdir = self.testRoot + '/tests' >+ testdirs =  >+ try: >+ f = self.device.getFile(manifest, "temp.txt") >+ for line in f.split(): >+ dir = line.rstrip() >+ path = manifestdir + '/' + dir >+ testdirs.append(path) >+ f.close() >+ except: >+ pass # just eat exceptions >+ return testdirs .... >+ >+ #todo: need a remote device fileExist() and dirExist() function I don't understand. Those do exist. You use them in verifyFile, verifyDir above this line. >+ def setAbsPath(self): >+ #testharnessdir is used for head.js ..snip.. >+ #NOTE: the only difference between this and parent is the " vs ' arond the filename >+ def buildCmdHead(self, headfiles, tailfiles, xpcscmd): >+ cmdH = ", ".join(['\'' + f.replace('\\', '/') + '\'' >+ for f in headfiles]) >+ cmdT = ", ".join(['\'' + f.replace('\\', '/') + '\'' >+ for f in tailfiles]) >+ cmdH = xpcscmd + \ >+ ['-e', 'const _HEAD_FILES = [%s];' % cmdH] + \ >+ ['-e', 'const _TAIL_FILES = [%s];' % cmdT] >+ return cmdH >+ >+ >+ Any particular reason for three blank lines ^ ? >+class RemoteXpcShellOptions(xpcshell.XpcShellOptions): This is why I'll have to minus. I think you have given me an incomplete patch. There is no target xpcshell.XpcShellOptions in runxpcshelltests.py. All the option parsing is still done in main and will require refactoring into a class for you to be able to inherit from it. So, this code will traceback until that is fixed. >+ #zip up the xpcshell directory: 7z a <zipName> xpcshell/*, assuming we are in the xpcshell directory This also makes the blanket assumption that 7z is installed on the build machines. That can be true for the remote case, certainly (i.e. we can control that). But we should probably add another comment pointing out that assumption for when developers run this code who may not have 7z installed.
Attachment #430476 - Flags: review?(ctalbert) → review-
please update with patch from bug 493748 to ensure this applies cleanly. Fixed couple of nits along the way.
updated for bitrot.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.