Commit 5be1f6aa authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

add -d (--debug) option to specify not to use Xvfb.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26207 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 28017073
......@@ -22,6 +22,7 @@ Options:
-s, --stdout prints the results on stdout instead of sending
results by email (unless email_to_address is also
passed explictly)
-d, --debug run firefox on current DISPLAY instead of on Xvfb passed explictly)
--host the hostname of this ERP5 instance
--port the port of this ERP5 instance
--portal_name the ID of the ERP5 site
......@@ -40,6 +41,7 @@ user = 'ERP5TypeTestCase'
password = ''
send_mail = 0
stdout = 0
debug = 0
email_to_address = 'erp5-report@erp5.org'
tests_framework_home = os.path.dirname(os.path.abspath(__file__))
......@@ -68,13 +70,14 @@ def usage(stream, msg=None):
def parseArgs():
global send_mail
global stdout
global debug
global email_to_address
global host
global port
global portal_name
try:
opts, args = getopt.getopt(sys.argv[1:],
"hs", ["help", "stdout",
"hsd", ["help", "stdout", "debug",
"email_to_address=", "host=", "port=", "portal_name="] )
except getopt.GetoptError, msg:
usage(sys.stderr, msg)
......@@ -83,6 +86,8 @@ def parseArgs():
for opt, arg in opts:
if opt in ("-s", "--stdout"):
stdout = 1
elif opt in ("-d", "--debug"):
debug = 1
elif opt == '--email_to_address':
email_to_address = arg
send_mail = 1
......@@ -106,6 +111,7 @@ def main():
xvfb_pid = None
firefox_pid = None
try:
if not debug:
xvfb_pid = runXvfb()
firefox_pid = runFirefox()
while True:
......@@ -179,6 +185,7 @@ user_pref("capability.principal.codebase.p1.subjectName", "");""" % \
def runFirefox():
os.environ['MOZ_NO_REMOTE'] = '1'
if not debug:
os.environ['DISPLAY'] = ':123'
os.environ['HOME'] = profile_dir
prepareFirefox()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment