Closed Bug 545867 Opened 14 years ago Closed 14 years ago

add remotexpcshelltests.py to mozilla-central

Categories

(Testing :: General, defect)

ARM
Windows Mobile 6 Professional
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jmaher, Assigned: jmaher)

References

Details

Attachments

(1 file, 3 obsolete files)

this is to add a remotexpcshelltests.py file which is a subclass of runxpcshelltests.py.
Assignee: nobody → jmaher
Blocks: 491903
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.
Attachment #426681 - Attachment is obsolete: true
Attachment #430476 - Flags: review?(ctalbert)
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.
Attachment #430476 - Attachment is obsolete: true
Attachment #431198 - Flags: review?(ctalbert)
updated for bitrot.
Attachment #431198 - Attachment is obsolete: true
Attachment #431890 - Flags: review?(ctalbert)
Attachment #431198 - Flags: review?(ctalbert)
Attachment #431890 - Flags: review?(ctalbert) → review+
Landed as http://hg.mozilla.org/mozilla-central/rev/00f20fbba759
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Component: New Frameworks → General
You need to log in before you can comment on or make changes to this bug.