Permalink
Browse files

Bug 713256 - Mirror mozbase changes for working properly on buildslav…

…es into m-c r=ctalbert
  • Loading branch information...
1 parent cb878c7 commit 137e8451af00be01c3d9f9aedb27bc5da40a332b @markrcote markrcote committed Dec 23, 2011
Showing with 2,894 additions and 152 deletions.
  1. +7 −4 testing/mozbase/README
  2. +9 −0 testing/mozbase/docs.manifest
  3. +5 −5 testing/mozbase/manifestdestiny/README.md
  4. +8 −2 testing/mozbase/mozinstall/mozinstall/mozinstall.py
  5. +18 −6 testing/mozbase/mozprocess/mozprocess/processhandler.py
  6. +1 −1 testing/mozbase/mozprocess/mozprocess/winprocess.py
  7. +2 −2 testing/mozbase/mozprocess/setup.py
  8. +57 −0 testing/mozbase/mozprocess/tests/Makefile
  9. +6 −0 testing/mozbase/mozprocess/tests/iniparser/AUTHORS
  10. +15 −0 testing/mozbase/mozprocess/tests/iniparser/INSTALL
  11. +21 −0 testing/mozbase/mozprocess/tests/iniparser/LICENSE
  12. +118 −0 testing/mozbase/mozprocess/tests/iniparser/Makefile
  13. +12 −0 testing/mozbase/mozprocess/tests/iniparser/README
  14. +407 −0 testing/mozbase/mozprocess/tests/iniparser/dictionary.c
  15. +176 −0 testing/mozbase/mozprocess/tests/iniparser/dictionary.h
  16. +648 −0 testing/mozbase/mozprocess/tests/iniparser/iniparser.c
  17. +273 −0 testing/mozbase/mozprocess/tests/iniparser/iniparser.h
  18. +2 −0 testing/mozbase/mozprocess/tests/manifest.ini
  19. +187 −0 testing/mozbase/mozprocess/tests/mozprocess1.py
  20. +177 −0 testing/mozbase/mozprocess/tests/mozprocess2.py
  21. +11 −0 testing/mozbase/mozprocess/tests/process_normal_finish.ini
  22. +11 −0 testing/mozbase/mozprocess/tests/process_waittimeout.ini
  23. +8 −0 testing/mozbase/mozprocess/tests/process_waittimeout_10s.ini
  24. +189 −0 testing/mozbase/mozprocess/tests/proclaunch.c
  25. +64 −3 testing/mozbase/mozprofile/README.md
  26. +1 −1 testing/mozbase/mozprofile/mozprofile/addons.py
  27. +10 −2 testing/mozbase/mozprofile/mozprofile/profile.py
  28. +146 −0 testing/mozbase/mozprofile/tests/addonid.py
  29. +3 −0 testing/mozbase/mozprofile/tests/manifest.ini
  30. +65 −0 testing/mozbase/mozprofile/tests/server_locations.py
  31. +141 −0 testing/mozbase/mozprofile/tests/testprofile.py
  32. +28 −125 testing/mozbase/mozrunner/mozrunner/runner.py
  33. +1 −1 testing/mozbase/mozrunner/setup.py
  34. +5 −0 testing/mozbase/test-manifest.ini
  35. +62 −0 testing/mozbase/test.py
@@ -1,7 +1,10 @@
-This is the git repo for the mozbase suite of python utilities.
+This is the git repo for the Mozilla mozbase suite of python utilities.
-Learn more about mozbase here: https://wiki.mozilla.org/Auto-tools/Projects/MozBase
+Learn more about mozbase here:
+https://wiki.mozilla.org/Auto-tools/Projects/MozBase
-Bugs live at https://bugzilla.mozilla.org/buglist.cgi?resolution=---&component=Mozbase&product=Testing and https://bugzilla.mozilla.org/buglist.cgi?resolution=---&status_whiteboard_type=allwordssubstr&query_format=advanced&status_whiteboard=mozbase
+Bugs live at
+https://bugzilla.mozilla.org/buglist.cgi?resolution=---&component=Mozbase&product=Testing and https://bugzilla.mozilla.org/buglist.cgi?resolution=---&status_whiteboard_type=allwordssubstr&query_format=advanced&status_whiteboard=mozbase
-To file a bug, go to https://bugzilla.mozilla.org/enter_bug.cgi?product=Testing&component=Mozbase
+To file a bug, go to
+https://bugzilla.mozilla.org/enter_bug.cgi?product=Testing&component=Mozbase
@@ -0,0 +1,9 @@
+#!/usr/bin/env document-it
+# documentation manifest for the Mozbase repo
+# To generate HTML from this markdown, use document_it:
+# http://pypi.python.org/pypi/document_it
+
+mozinfo/README.md en/Mozinfo
+mozprocess/README.md en/Mozprocess
+mozprofile/README.md en/Mozprofile
+mozrunner/README.md en/Mozrunner
@@ -10,11 +10,11 @@ What ManifestDestiny gives you:
are just dicts with some keys. For example, a test with no
user-specified metadata looks like this:
- [{'path':
- '/home/jhammel/mozmill/src/ManifestDestiny/manifestdestiny/tests/testToolbar/testBackForwardButtons.js',
- 'name': 'testToolbar/testBackForwardButtons.js', 'here':
- '/home/jhammel/mozmill/src/ManifestDestiny/manifestdestiny/tests',
- 'manifest': '/home/jhammel/mozmill/src/ManifestDestiny/manifestdestiny/tests',}]
+ [{'path':
+ '/home/jhammel/mozmill/src/ManifestDestiny/manifestdestiny/tests/testToolbar/testBackForwardButtons.js',
+ 'name': 'testToolbar/testBackForwardButtons.js', 'here':
+ '/home/jhammel/mozmill/src/ManifestDestiny/manifestdestiny/tests',
+ 'manifest': '/home/jhammel/mozmill/src/ManifestDestiny/manifestdestiny/tests',}]
The keys displayed here (path, name, here, and manifest) are reserved
keys for ManifestDestiny and any consuming APIs. You can add
@@ -170,12 +170,18 @@ def _install_dmg(src, dest):
if appFile.endswith(".app"):
appName = appFile
break
- subprocess.call("cp -r " + os.path.join(appDir, appName) + " " + dest,
+
+ dest = os.path.join(dest, appName)
+ assert not os.path.isfile(dest)
+ if not os.path.isdir(dest):
+ os.makedirs(dest)
+ subprocess.call("cp -r " +
+ os.path.join(appDir,appName, "*") + " " + dest,
shell=True)
finally:
subprocess.call("hdiutil detach " + appDir + " -quiet",
shell=True)
- return os.path.join(dest, appName)
+ return dest
def _install_exe(src, dest):
# possibly gets around UAC in vista (still need to run as administrator)
@@ -46,6 +46,7 @@
import sys
import threading
import time
+import traceback
from Queue import Queue
from datetime import datetime, timedelta
@@ -111,7 +112,10 @@ def setpgidfn():
def __del__(self, _maxint=sys.maxint):
if mozinfo.isWin:
if self._handle:
- self._internal_poll(_deadstate=_maxint)
+ if hasattr(self, '_internal_poll'):
+ self._internal_poll(_deadstate=_maxint)
+ else:
+ self.poll(_deadstate=sys.maxint)
if self._handle or self._job or self._io_port:
self._cleanup()
else:
@@ -257,13 +261,15 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
except:
print >> sys.stderr, """Exception trying to use job objects;
falling back to not using job objects for managing child processes"""
+ tb = traceback.format_exc()
+ print >> sys.stderr, tb
# Ensure no dangling handles left behind
self._cleanup_job_io_port()
else:
self._job = None
winprocess.ResumeThread(int(ht))
- if self._procmgrthread:
+ if getattr(self, '_procmgrthread', None):
self._procmgrthread.start()
ht.Close()
@@ -373,7 +379,13 @@ def _wait(self):
# Dude, the process is like totally dead!
return self.returncode
- if self._job and self._procmgrthread.is_alive():
+ # Python 2.5 uses isAlive versus is_alive use the proper one
+ threadalive = False
+ if hasattr(self._procmgrthread, 'is_alive'):
+ threadalive = self._procmgrthread.is_alive()
+ else:
+ threadalive = self._procmgrthread.isAlive()
+ if self._job and threadalive:
# Then we are managing with IO Completion Ports
# wait on a signal so we know when we have seen the last
# process come through.
@@ -429,21 +441,21 @@ def _cleanup_job_io_port(self):
cases where we want to clean these without killing _handle
(i.e. if we fail to create the job object in the first place)
"""
- if self._job and self._job != winprocess.INVALID_HANDLE_VALUE:
+ if getattr(self, '_job') and self._job != winprocess.INVALID_HANDLE_VALUE:
self._job.Close()
self._job = None
else:
# If windows already freed our handle just set it to none
# (saw this intermittently while testing)
self._job = None
- if self._io_port and self._io_port != winprocess.INVALID_HANDLE_VALUE:
+ if getattr(self, '_io_port', None) and self._io_port != winprocess.INVALID_HANDLE_VALUE:
self._io_port.Close()
self._io_port = None
else:
self._io_port = None
- if self._procmgrthread:
+ if getattr(self, '_procmgrthread', None):
self._procmgrthread = None
def _cleanup(self):
@@ -255,7 +255,7 @@ def ErrCheckCreateProcess(result, func, args):
DWORD # Number of Threads
)
CreateIoCompletionPortFlags = ((1, "FileHandle", INVALID_HANDLE_VALUE),
- (1, "ExistingCompletionPort", None),
+ (1, "ExistingCompletionPort", 0),
(1, "CompletionKey", c_ulong(0)),
(1, "NumberOfConcurrentThreads", 0))
CreateIoCompletionPort = CreateIoCompletionPortProto(("CreateIoCompletionPort",
@@ -56,8 +56,8 @@
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='Mozilla Automation and Testing Team',
- author_email='mozmill-dev@googlegroups.com',
- url='http://github.com/mozautomation/mozmill',
+ author_email='tools@lists.mozilla.com',
+ url='https://github.com/mozilla/mozbase/tree/master/mozprocess',
license='MPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
@@ -0,0 +1,57 @@
+#
+# proclaunch tests Makefile
+#
+UNAME := $(shell uname -s)
+ifeq ($(UNAME), MINGW32_NT-6.1)
+WIN32 = 1
+endif
+ifeq ($(UNAME), MINGW32_NT-5.1)
+WIN32 = 1
+endif
+
+ifeq ($(WIN32), 1)
+CC = cl
+LINK = link
+CFLAGS = //Od //I "iniparser" //D "WIN32" //D "_WIN32" //D "_DEBUG" //D "_CONSOLE" //D "_UNICODE" //D "UNICODE" //Gm //EHsc //RTC1 //MDd //W3 //nologo //c //ZI //TC
+LFLAGS = //OUT:"proclaunch.exe" //INCREMENTAL //LIBPATH:"iniparser\\" //NOLOGO //DEBUG //SUBSYSTEM:CONSOLE //DYNAMICBASE //NXCOMPAT //MACHINE:X86 //ERRORREPORT:PROMPT iniparser.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
+RM = rm -f
+
+default: all
+all: iniparser proclaunch
+
+iniparser:
+ $(MAKE) -C iniparser
+
+proclaunch.obj: proclaunch.c
+ $(CC) $(CFLAGS) proclaunch.c
+
+proclaunch: proclaunch.obj
+ $(LINK) $(LFLAGS) proclaunch.obj
+
+else
+CC = gcc
+ifeq ($(UNAME), Linux)
+CFLAGS = -g -v -Iiniparser
+else
+CFLAGS = -g -v -arch i386 -Iiniparser
+endif
+
+LFLAGS = -L.. -liniparser
+AR = ar
+ARFLAGS = rcv
+RM = rm -f
+
+
+default: all
+
+all: libiniparser.a proclaunch
+
+libiniparser.a:
+ $(MAKE) -C iniparser
+
+proclaunch: proclaunch.c
+ $(CC) $(CFLAGS) -o proclaunch proclaunch.c -Iiniparser -Liniparser -liniparser
+
+clean veryclean:
+ $(RM) proclaunch
+endif
@@ -0,0 +1,6 @@
+Author: Nicolas Devillard <ndevilla@free.fr>
+
+This tiny library has received countless contributions and I have
+not kept track of all the people who contributed. Let them be thanked
+for their ideas, code, suggestions, corrections, enhancements!
+
@@ -0,0 +1,15 @@
+
+iniParser installation instructions
+-----------------------------------
+
+- Modify the Makefile to suit your environment.
+- Type 'make' to make the library.
+- Type 'make check' to make the test program.
+- Type 'test/iniexample' to launch the test program.
+- Type 'test/parse' to launch torture tests.
+
+
+
+Enjoy!
+N. Devillard
+Wed Mar 2 21:14:17 CET 2011
@@ -0,0 +1,21 @@
+Copyright (c) 2000-2011 by Nicolas Devillard.
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
@@ -0,0 +1,118 @@
+#
+# iniparser Makefile
+#
+UNAME := $(shell uname -s)
+ifeq ($(UNAME), MINGW32_NT-6.1)
+WIN32 = 1
+endif
+ifeq ($(UNAME), MINGW32_NT-5.1)
+WIN32 = 1
+endif
+
+ifeq ($(UNAME), Linux)
+ # Compiler settings
+ CC = gcc
+ # Ar settings to build the library
+ AR = ar
+ ARFLAGS = rcv
+ SHLD = ${CC} ${CFLAGS}
+ CFLAGS = -O2 -fPIC -Wall -ansi -pedantic
+ LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
+ LDFLAGS = -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
+endif
+
+ifeq ($(UNAME), Darwin)
+ # Compiler settings
+ CC = gcc
+ # Ar settings to build the library
+ AR = ar
+ ARFLAGS = rcv
+ #SHLD = ${CC} ${CFLAGS}
+ SHLD = libtool
+ CFLAGS = -v -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk -fPIC -Wall -ansi -pedantic
+ LDFLAGS = -arch_only i386
+endif
+
+ifeq ($(WIN32), 1)
+ CC = cl
+ CFLAGS = //Od //D "_WIN32" //D "WIN32" //D "_CONSOLE" //D "_CRT_SECURE_NO_WARNINGS" //D "_UNICODE" //D "UNICODE" //Gm //EHsc //RTC1 //MDd //W3 //nologo //c //ZI //TC
+ LDFLAGS = //OUT:"iniparser.lib" //NOLOGO
+ LINK = lib
+endif
+
+ifeq ($(WIN32), 1)
+SUFFIXES = .obj .c .h .lib
+
+COMPILE.c=$(CC) $(CFLAGS) -c
+
+#.c.obj:
+# @(echo "compiling $< ...")
+# @($(COMPILE.c) $@ $<)
+
+all: iniparser.obj dictionary.obj iniparser.lib
+
+SRCS = iniparser.c \
+ dictionary.c
+OBJS = $(SRCS:.c=.obj)
+
+iniparser.obj: dictionary.obj
+ @($(CC) $(CFLAGS) iniparser.c)
+
+dictionary.obj:
+ @($(CC) $(CFLAGS) dictionary.c)
+
+iniparser.lib: dictionary.obj iniparser.obj
+ @(echo "linking $(OBJS)")
+ @($(LINK) $(LDFLAGS) $(OBJS))
+
+else
+# Set RANLIB to ranlib on systems that require it (Sun OS < 4, Mac OSX)
+# RANLIB = ranlib
+RANLIB = true
+
+RM = rm -f
+
+# Implicit rules
+
+SUFFIXES = .o .c .h .a .so .sl
+
+COMPILE.c=$(CC) $(CFLAGS) -c
+.c.o:
+ @(echo "compiling $< ...")
+ @($(COMPILE.c) -o $@ $<)
+
+
+SRCS = iniparser.c \
+ dictionary.c
+
+OBJS = $(SRCS:.c=.o)
+
+
+default: libiniparser.a libiniparser.so
+
+libiniparser.a: $(OBJS)
+ @($(AR) $(ARFLAGS) libiniparser.a $(OBJS))
+ @($(RANLIB) libiniparser.a)
+
+ifeq ($(UNAME), Linux)
+libiniparser.so: $(OBJS)
+ @$(SHLD) $(LDSHFLAGS) -o $@.0 $(OBJS) $(LDFLAGS)
+else
+libiniparser.so: $(OBJS)
+ @$(SHLD) -o $@.0 $(LDFLAGS) $(OBJS)
+endif
+endif
+
+clean:
+ $(RM) $(OBJS)
+
+veryclean:
+ $(RM) $(OBJS) libiniparser.a libiniparser.so*
+ rm -rf ./html ; mkdir html
+ cd test ; $(MAKE) veryclean
+
+docs:
+ @(cd doc ; $(MAKE))
+
+check:
+ @(cd test ; $(MAKE))
@@ -0,0 +1,12 @@
+
+Welcome to iniParser -- version 3.0
+released 02 Mar 2011
+
+This modules offers parsing of ini files from the C level.
+See a complete documentation in HTML format, from this directory
+open the file html/index.html with any HTML-capable browser.
+
+Enjoy!
+
+N.Devillard
+Wed Mar 2 21:46:14 CET 2011
Oops, something went wrong.

0 comments on commit 137e845

Please sign in to comment.