~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to mozilla/build/leaktest.py.in

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#literal #!/usr/bin/python
 
2
#
 
3
# This Source Code Form is subject to the terms of the Mozilla Public
 
4
# License, v. 2.0. If a copy of the MPL was not distributed with this
 
5
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
6
 
 
7
import SimpleHTTPServer
 
8
import SocketServer
 
9
import threading
 
10
import os
 
11
import sys
 
12
import logging
 
13
from getopt import getopt
 
14
from automation import Automation
 
15
 
 
16
PORT = 8888
 
17
SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])))
 
18
PROFILE_DIRECTORY = os.path.abspath(os.path.join(SCRIPT_DIR, "./leakprofile"))
 
19
os.chdir(SCRIPT_DIR)
 
20
 
 
21
class EasyServer(SocketServer.TCPServer):
 
22
    allow_reuse_address = True
 
23
 
 
24
if __name__ == '__main__':
 
25
    automation = Automation()
 
26
    DIST_BIN = os.path.join(SCRIPT_DIR, automation.DIST_BIN)
 
27
    opts, extraArgs = getopt(sys.argv[1:], 'l:')
 
28
    if len(opts) > 0:
 
29
        try:
 
30
            automation.log.addHandler(logging.FileHandler(opts[0][1], "w"))
 
31
        except:
 
32
            automation.log.info("Unable to open logfile " + opts[0][1] + \
 
33
                                "ONLY logging to stdout.")
 
34
 
 
35
    httpd = EasyServer(("", PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
 
36
    t = threading.Thread(target=httpd.serve_forever)
 
37
    t.setDaemon(True)
 
38
    t.start()
 
39
 
 
40
    automation.setServerInfo("localhost", PORT)
 
41
    automation.initializeProfile(PROFILE_DIRECTORY)
 
42
    browserEnv = automation.environment()
 
43
 
 
44
    if not "XPCOM_DEBUG_BREAK" in browserEnv:
 
45
        browserEnv["XPCOM_DEBUG_BREAK"] = "stack"
 
46
    url = "http://localhost:%d/bloatcycle.html" % PORT
 
47
    appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
 
48
    status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY,
 
49
                               # leaktest builds are slow, give up and
 
50
                               # don't use a timeout.
 
51
                               extraArgs, timeout=None)
 
52
    sys.exit(status)