当前位置: 首页>>代码示例>>Python>>正文


Python mozinfo.update函数代码示例

本文整理汇总了Python中mozinfo.update函数的典型用法代码示例。如果您正苦于以下问题:Python update函数的具体用法?Python update怎么用?Python update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了update函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_update_file

 def test_update_file(self):
     """Test that mozinfo.update can load a JSON file."""
     j = os.path.join(self.tempdir, "mozinfo.json")
     with open(j, "w") as f:
         f.write(json.dumps({"foo": "xyz"}))
     mozinfo.update(j)
     self.assertEqual(mozinfo.info["foo"], "xyz")
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:7,代码来源:test.py

示例2: test_update

 def test_update(self):
     """Test that mozinfo.update works."""
     mozinfo.update({"foo": 123})
     self.assertEqual(mozinfo.info["foo"], 123)
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:4,代码来源:test.py

示例3: validate

    def validate(self, parser, options, context):
        """Validate generic options."""

        # for test manifest parsing.
        mozinfo.update({"strictContentSandbox": options.strictContentSandbox})
        # for test manifest parsing.
        mozinfo.update({"nested_oop": options.nested_oop})

        # b2g and android don't use 'app' the same way, so skip validation
        if parser.app not in ('b2g', 'android'):
            if options.app is None:
                if build_obj:
                    options.app = build_obj.get_binary_path()
                else:
                    parser.error(
                        "could not find the application path, --appname must be specified")
            elif options.app == "dist" and build_obj:
                options.app = build_obj.get_binary_path(where='staged-package')

            options.app = self.get_full_path(options.app, parser.oldcwd)
            if not os.path.exists(options.app):
                parser.error("Error: Path {} doesn't exist. Are you executing "
                             "$objdir/_tests/testing/mochitest/runtests.py?".format(
                                 options.app))

        if options.gmp_path is None and options.app and build_obj:
            # Need to fix the location of gmp_fake which might not be shipped in the binary
            gmp_modules = (
                ('gmp-fake', '1.0'),
                ('gmp-clearkey', '0.1'),
                ('gmp-fakeopenh264', '1.0')
            )
            options.gmp_path = os.pathsep.join(
                os.path.join(build_obj.bindir, *p) for p in gmp_modules)

        if options.ipcplugins:
            options.test_paths.append('dom/plugins/test/mochitest')

        if options.totalChunks is not None and options.thisChunk is None:
            parser.error(
                "thisChunk must be specified when totalChunks is specified")

        if options.totalChunks:
            if not 1 <= options.thisChunk <= options.totalChunks:
                parser.error("thisChunk must be between 1 and totalChunks")

        if options.chunkByDir and options.chunkByRuntime:
            parser.error(
                "can only use one of --chunk-by-dir or --chunk-by-runtime")

        if options.xrePath is None:
            # default xrePath to the app path if not provided
            # but only if an app path was explicitly provided
            if options.app != parser.get_default('app'):
                options.xrePath = os.path.dirname(options.app)
                if mozinfo.isMac:
                    options.xrePath = os.path.join(
                        os.path.dirname(
                            options.xrePath),
                        "Resources")
            elif build_obj is not None:
                # otherwise default to dist/bin
                options.xrePath = build_obj.bindir
            else:
                parser.error(
                    "could not find xre directory, --xre-path must be specified")

        # allow relative paths
        if options.xrePath:
            options.xrePath = self.get_full_path(options.xrePath, parser.oldcwd)

        if options.profilePath:
            options.profilePath = self.get_full_path(options.profilePath, parser.oldcwd)

        if options.dmdPath:
            options.dmdPath = self.get_full_path(options.dmdPath, parser.oldcwd)

        if options.dmd and not options.dmdPath:
            if build_obj:
                options.dmdPath = build_obj.bin_dir
            else:
                parser.error(
                    "could not find dmd libraries, specify them with --dmd-path")

        if options.utilityPath:
            options.utilityPath = self.get_full_path(options.utilityPath, parser.oldcwd)

        if options.certPath:
            options.certPath = self.get_full_path(options.certPath, parser.oldcwd)
        elif build_obj:
            options.certPath = os.path.join(build_obj.topsrcdir, 'build', 'pgo', 'certs')

        if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
            options.symbolsPath = self.get_full_path(options.symbolsPath, parser.oldcwd)
        elif not options.symbolsPath and build_obj:
            options.symbolsPath = os.path.join(build_obj.distdir, 'crashreporter-symbols')

        if options.vmwareRecording:
            if not mozinfo.isWin:
                parser.error(
#.........这里部分代码省略.........
开发者ID:nafis-sadik,项目名称:gecko-dev,代码行数:101,代码来源:mochitest_options.py

示例4: runTests


#.........这里部分代码省略.........
    self.logfiles = logfiles
    self.totalChunks = totalChunks
    self.thisChunk = thisChunk
    self.debuggerInfo = getDebuggerInfo(self.oldcwd, debugger, debuggerArgs, debuggerInteractive)
    self.profileName = profileName or "xpcshell"
    self.mozInfo = mozInfo
    self.testingModulesDir = testingModulesDir

    # If we have an interactive debugger, disable ctrl-c.
    if self.debuggerInfo and self.debuggerInfo["interactive"]:
        signal.signal(signal.SIGINT, lambda signum, frame: None)

    if not testdirs and not manifest:
      # nothing to test!
      self.log.error("Error: No test dirs or test manifest specified!")
      return False

    self.testCount = 0
    self.passCount = 0
    self.failCount = 0
    self.todoCount = 0

    self.setAbsPath()
    self.buildXpcsRunArgs()
    self.buildEnvironment()

    # Handle filenames in mozInfo
    if not isinstance(self.mozInfo, dict):
      mozInfoFile = self.mozInfo
      if not os.path.isfile(mozInfoFile):
        self.log.error("Error: couldn't find mozinfo.json at '%s'. Perhaps you need to use --build-info-json?" % mozInfoFile)
        return False
      self.mozInfo = parse_json(open(mozInfoFile).read())
    mozinfo.update(self.mozInfo)

    # We have to do this before we build the test list so we know whether or
    # not to run tests that depend on having the node spdy server
    self.trySetupNode()

    pStdout, pStderr = self.getPipes()

    self.buildTestList()

    if shuffle:
      random.shuffle(self.alltests)

    xunitResults = []

    for test in self.alltests:
      name = test['path']
      if self.singleFile and not name.endswith(self.singleFile):
        continue

      if self.testPath and name.find(self.testPath) == -1:
        continue

      self.testCount += 1

      xunitResult = {"name": test["name"], "classname": "xpcshell"}
      # The xUnit package is defined as the path component between the root
      # dir and the test with path characters replaced with '.' (using Java
      # class notation).
      if testsRootDir is not None:
          testsRootDir = os.path.normpath(testsRootDir)
          if test["here"].find(testsRootDir) != 0:
              raise Exception("testsRootDir is not a parent path of %s" %
开发者ID:marcofreda527,项目名称:jb412gecko,代码行数:67,代码来源:runxpcshelltests.py

示例5: validate

    def validate(self, parser, options, context):
        """Validate android options."""

        if build_obj:
            options.log_mach = '-'

        if options.dm_trans == "adb":
            if options.deviceIP:
                options.dm = DroidADB(
                    options.deviceIP,
                    options.devicePort,
                    deviceRoot=options.remoteTestRoot)
            elif options.deviceSerial:
                options.dm = DroidADB(
                    None,
                    None,
                    deviceSerial=options.deviceSerial,
                    deviceRoot=options.remoteTestRoot)
            else:
                options.dm = DroidADB(deviceRoot=options.remoteTestRoot)
        elif options.dm_trans == 'sut':
            if options.deviceIP is None:
                parser.error(
                    "If --dm_trans = sut, you must provide a device IP")

            options.dm = DroidSUT(
                options.deviceIP,
                options.devicePort,
                deviceRoot=options.remoteTestRoot)

        if not options.remoteTestRoot:
            options.remoteTestRoot = options.dm.deviceRoot

        if options.remoteWebServer is None:
            if os.name != "nt":
                options.remoteWebServer = moznetwork.get_ip()
            else:
                parser.error(
                    "you must specify a --remote-webserver=<ip address>")

        options.webServer = options.remoteWebServer

        if options.remoteLogFile is None:
            options.remoteLogFile = options.remoteTestRoot + \
                '/logs/mochitest.log'

        if options.remoteLogFile.count('/') < 1:
            options.remoteLogFile = options.remoteTestRoot + \
                '/' + options.remoteLogFile

        if options.remoteAppPath and options.app:
            parser.error(
                "You cannot specify both the remoteAppPath and the app setting")
        elif options.remoteAppPath:
            options.app = options.remoteTestRoot + "/" + options.remoteAppPath
        elif options.app is None:
            if build_obj:
                options.app = build_obj.substs['ANDROID_PACKAGE_NAME']
            else:
                # Neither remoteAppPath nor app are set -- error
                parser.error("You must specify either appPath or app")

        if build_obj and 'MOZ_HOST_BIN' in os.environ:
            options.xrePath = os.environ['MOZ_HOST_BIN']

        # Only reset the xrePath if it wasn't provided
        if options.xrePath is None:
            options.xrePath = options.utilityPath

        if options.pidFile != "":
            f = open(options.pidFile, 'w')
            f.write("%s" % os.getpid())
            f.close()

        # Robocop specific options
        if options.robocopIni != "":
            if not os.path.exists(options.robocopIni):
                parser.error(
                    "Unable to find specified robocop .ini manifest '%s'" %
                    options.robocopIni)
            options.robocopIni = os.path.abspath(options.robocopIni)

            if not options.robocopApk and build_obj:
                options.robocopApk = os.path.join(build_obj.topobjdir, 'mobile', 'android',
                                                  'tests', 'browser',
                                                  'robocop', 'robocop-debug.apk')

        if options.robocopApk != "":
            if not os.path.exists(options.robocopApk):
                parser.error(
                    "Unable to find robocop APK '%s'" %
                    options.robocopApk)
            options.robocopApk = os.path.abspath(options.robocopApk)

        # Disable e10s by default on Android because we don't run Android
        # e10s jobs anywhere yet.
        options.e10s = False
        mozinfo.update({'e10s': options.e10s})

        # allow us to keep original application around for cleanup while
#.........这里部分代码省略.........
开发者ID:brendandahl,项目名称:positron,代码行数:101,代码来源:mochitest_options.py

示例6: runTests

  def runTests(self, xpcshell, xrePath=None, appPath=None, symbolsPath=None,
               manifest=None, testdirs=[], testPath=None,
               interactive=False, verbose=False, keepGoing=False, logfiles=True,
               thisChunk=1, totalChunks=1, debugger=None,
               debuggerArgs=None, debuggerInteractive=False,
               profileName=None, mozInfo=None, **otherOptions):
    """Run xpcshell tests.

    |xpcshell|, is the xpcshell executable to use to run the tests.
    |xrePath|, if provided, is the path to the XRE to use.
    |appPath|, if provided, is the path to an application directory.
    |symbolsPath|, if provided is the path to a directory containing
      breakpad symbols for processing crashes in tests.
    |manifest|, if provided, is a file containing a list of
      test directories to run.
    |testdirs|, if provided, is a list of absolute paths of test directories.
      No-manifest only option.
    |testPath|, if provided, indicates a single path and/or test to run.
    |interactive|, if set to True, indicates to provide an xpcshell prompt
      instead of automatically executing the test.
    |verbose|, if set to True, will cause stdout/stderr from tests to
      be printed always
    |logfiles|, if set to False, indicates not to save output to log files.
      Non-interactive only option.
    |debuggerInfo|, if set, specifies the debugger and debugger arguments
      that will be used to launch xpcshell.
    |profileName|, if set, specifies the name of the application for the profile
      directory if running only a subset of tests.
    |mozInfo|, if set, specifies specifies build configuration information, either as a filename containing JSON, or a dict.
    |otherOptions| may be present for the convenience of subclasses
    """

    global gotSIGINT 

    self.xpcshell = xpcshell
    self.xrePath = xrePath
    self.appPath = appPath
    self.symbolsPath = symbolsPath
    self.manifest = manifest
    self.testdirs = testdirs
    self.testPath = testPath
    self.interactive = interactive
    self.verbose = verbose
    self.keepGoing = keepGoing
    self.logfiles = logfiles
    self.totalChunks = totalChunks
    self.thisChunk = thisChunk
    self.debuggerInfo = getDebuggerInfo(self.oldcwd, debugger, debuggerArgs, debuggerInteractive)
    self.profileName = profileName or "xpcshell"
    self.mozInfo = mozInfo

    # If we have an interactive debugger, disable ctrl-c.
    if self.debuggerInfo and self.debuggerInfo["interactive"]:
        signal.signal(signal.SIGINT, lambda signum, frame: None)

    if not testdirs and not manifest:
      # nothing to test!
      self.log.error("Error: No test dirs or test manifest specified!")
      return False

    self.testCount = 0
    self.passCount = 0
    self.failCount = 0
    self.todoCount = 0

    self.setAbsPath()
    self.buildXpcsRunArgs()
    self.buildEnvironment()

    # Handle filenames in mozInfo
    if not isinstance(self.mozInfo, dict):
      mozInfoFile = self.mozInfo
      if not os.path.isfile(mozInfoFile):
        self.log.error("Error: couldn't find mozinfo.json at '%s'. Perhaps you need to use --build-info-json?" % mozInfoFile)
        return False
      self.mozInfo = parse_json(open(mozInfoFile).read())
    mozinfo.update(self.mozInfo)
    
    pStdout, pStderr = self.getPipes()

    self.buildTestList()

    for test in self.alltests:
      name = test['path']
      if self.singleFile and not name.endswith(self.singleFile):
        continue

      if self.testPath and name.find(self.testPath) == -1:
        continue

      self.testCount += 1

      # Check for skipped tests
      if 'disabled' in test:
        self.log.info("TEST-INFO | skipping %s | %s" %
                      (name, test['disabled']))
        continue
      # Check for known-fail tests
      expected = test['expected'] == 'pass'

#.........这里部分代码省略.........
开发者ID:krellian,项目名称:mozilla-central,代码行数:101,代码来源:runxpcshelltests.py

示例7: validate

    def validate(self, parser, options, context):
        """Validate android options."""

        if build_obj:
            options.log_mach = '-'

        device_args = {'deviceRoot': options.remoteTestRoot}
        device_args['adbPath'] = options.adbPath
        if options.deviceIP:
            device_args['host'] = options.deviceIP
            device_args['port'] = options.devicePort
        elif options.deviceSerial:
            device_args['deviceSerial'] = options.deviceSerial

        if options.log_tbpl_level == 'debug' or options.log_mach_level == 'debug':
            device_args['logLevel'] = logging.DEBUG
        options.dm = DroidADB(**device_args)

        if not options.remoteTestRoot:
            options.remoteTestRoot = options.dm.deviceRoot

        if options.remoteWebServer is None:
            if os.name != "nt":
                options.remoteWebServer = moznetwork.get_ip()
            else:
                parser.error(
                    "you must specify a --remote-webserver=<ip address>")

        options.webServer = options.remoteWebServer

        if options.remoteLogFile is None:
            options.remoteLogFile = options.remoteTestRoot + \
                '/logs/mochitest.log'

        if options.remoteLogFile.count('/') < 1:
            options.remoteLogFile = options.remoteTestRoot + \
                '/' + options.remoteLogFile

        if options.remoteAppPath and options.app:
            parser.error(
                "You cannot specify both the remoteAppPath and the app setting")
        elif options.remoteAppPath:
            options.app = options.remoteTestRoot + "/" + options.remoteAppPath
        elif options.app is None:
            if build_obj:
                options.app = build_obj.substs['ANDROID_PACKAGE_NAME']
            else:
                # Neither remoteAppPath nor app are set -- error
                parser.error("You must specify either appPath or app")

        if build_obj and 'MOZ_HOST_BIN' in os.environ:
            options.xrePath = os.environ['MOZ_HOST_BIN']

        # Only reset the xrePath if it wasn't provided
        if options.xrePath is None:
            options.xrePath = options.utilityPath

        if build_obj:
            options.topsrcdir = build_obj.topsrcdir

        if options.pidFile != "":
            f = open(options.pidFile, 'w')
            f.write("%s" % os.getpid())
            f.close()

        # Robocop specific options
        if options.robocopIni != "":
            if not os.path.exists(options.robocopIni):
                parser.error(
                    "Unable to find specified robocop .ini manifest '%s'" %
                    options.robocopIni)
            options.robocopIni = os.path.abspath(options.robocopIni)

            if not options.robocopApk and build_obj:
                if build_obj.substs.get('MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE'):
                    options.robocopApk = os.path.join(build_obj.topobjdir, 'gradle', 'build',
                                                      'mobile', 'android', 'app', 'outputs', 'apk',
                                                      'app-official-australis-debug-androidTest-'
                                                      'unaligned.apk')
                else:
                    options.robocopApk = os.path.join(build_obj.topobjdir, 'mobile', 'android',
                                                      'tests', 'browser',
                                                      'robocop', 'robocop-debug.apk')

        if options.robocopApk != "":
            if not os.path.exists(options.robocopApk):
                parser.error(
                    "Unable to find robocop APK '%s'" %
                    options.robocopApk)
            options.robocopApk = os.path.abspath(options.robocopApk)

        # Disable e10s by default on Android because we don't run Android
        # e10s jobs anywhere yet.
        options.e10s = False
        mozinfo.update({'e10s': options.e10s})

        # allow us to keep original application around for cleanup while
        # running robocop via 'am'
        options.remoteappname = options.app
        return options
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:100,代码来源:mochitest_options.py

示例8: verifyOptions

    def verifyOptions(self, options, mochitest):
        """ verify correct options and cleanup paths """

        # for test manifest parsing.
        mozinfo.update({"strictContentSandbox": options.strictContentSandbox})
        # for test manifest parsing.
        mozinfo.update({"nested_oop": options.nested_oop})

        if options.app is None:
            if build_obj is not None:
                options.app = build_obj.get_binary_path()
            else:
                self.error(
                    "could not find the application path, --appname must be specified")

        if options.totalChunks is not None and options.thisChunk is None:
            self.error(
                "thisChunk must be specified when totalChunks is specified")

        if options.totalChunks:
            if not 1 <= options.thisChunk <= options.totalChunks:
                self.error("thisChunk must be between 1 and totalChunks")

        if options.chunkByDir and options.chunkByRuntime:
            self.error(
                "can only use one of --chunk-by-dir or --chunk-by-runtime")

        if options.xrePath is None:
            # default xrePath to the app path if not provided
            # but only if an app path was explicitly provided
            if options.app != self.get_default('app'):
                options.xrePath = os.path.dirname(options.app)
                if mozinfo.isMac:
                    options.xrePath = os.path.join(
                        os.path.dirname(
                            options.xrePath),
                        "Resources")
            elif build_obj is not None:
                # otherwise default to dist/bin
                options.xrePath = build_obj.bindir
            else:
                self.error(
                    "could not find xre directory, --xre-path must be specified")

        # allow relative paths
        options.xrePath = mochitest.getFullPath(options.xrePath)
        if options.profilePath:
            options.profilePath = mochitest.getFullPath(options.profilePath)
        options.app = mochitest.getFullPath(options.app)
        if options.dmdPath is not None:
            options.dmdPath = mochitest.getFullPath(options.dmdPath)

        if not os.path.exists(options.app):
            msg = """\
            Error: Path %(app)s doesn't exist.
            Are you executing $objdir/_tests/testing/mochitest/runtests.py?"""
            self.error(msg % {"app": options.app})
            return None

        if options.utilityPath:
            options.utilityPath = mochitest.getFullPath(options.utilityPath)

        if options.certPath:
            options.certPath = mochitest.getFullPath(options.certPath)

        if options.symbolsPath and len(
            urlparse(
                options.symbolsPath).scheme) < 2:
            options.symbolsPath = mochitest.getFullPath(options.symbolsPath)

        # Set server information on the options object
        options.webServer = '127.0.0.1'
        options.httpPort = DEFAULT_PORTS['http']
        options.sslPort = DEFAULT_PORTS['https']
        #        options.webSocketPort = DEFAULT_PORTS['ws']
        # <- http://hg.mozilla.org/mozilla-central/file/b871dfb2186f/build/automation.py.in#l30
        options.webSocketPort = str(9988)
        # The default websocket port is incorrect in mozprofile; it is
        # set to the SSL proxy setting. See:
        # see https://bugzilla.mozilla.org/show_bug.cgi?id=916517

        if options.vmwareRecording:
            if not mozinfo.isWin:
                self.error(
                    "use-vmware-recording is only supported on Windows.")
            mochitest.vmwareHelperPath = os.path.join(
                options.utilityPath, VMWARE_RECORDING_HELPER_BASENAME + ".dll")
            if not os.path.exists(mochitest.vmwareHelperPath):
                self.error("%s not found, cannot automate VMware recording." %
                           mochitest.vmwareHelperPath)

        if options.webapprtContent and options.webapprtChrome:
            self.error(
                "Only one of --webapprt-content and --webapprt-chrome may be given.")

        if options.jsdebugger:
            options.extraPrefs += [
                "devtools.debugger.remote-enabled=true",
                "devtools.chrome.enabled=true",
                "devtools.debugger.prompt-connection=false"
#.........这里部分代码省略.........
开发者ID:LordJZ,项目名称:gecko-dev,代码行数:101,代码来源:mochitest_options.py

示例9: validate

    def validate(self, parser, options, context):
        """Validate generic options."""

        # for test manifest parsing.
        mozinfo.update({"nested_oop": options.nested_oop})

        # and android doesn't use 'app' the same way, so skip validation
        if parser.app != 'android':
            if options.app is None:
                if build_obj:
                    options.app = build_obj.get_binary_path()
                else:
                    parser.error(
                        "could not find the application path, --appname must be specified")
            elif options.app == "dist" and build_obj:
                options.app = build_obj.get_binary_path(where='staged-package')

            options.app = self.get_full_path(options.app, parser.oldcwd)
            if not os.path.exists(options.app):
                parser.error("Error: Path {} doesn't exist. Are you executing "
                             "$objdir/_tests/testing/mochitest/runtests.py?".format(
                                 options.app))

        if options.flavor is None:
            options.flavor = 'plain'

        if options.gmp_path is None and options.app and build_obj:
            # Need to fix the location of gmp_fake which might not be shipped in the binary
            gmp_modules = (
                ('gmp-fake', '1.0'),
                ('gmp-clearkey', '0.1'),
                ('gmp-fakeopenh264', '1.0')
            )
            options.gmp_path = os.pathsep.join(
                os.path.join(build_obj.bindir, *p) for p in gmp_modules)

        if options.totalChunks is not None and options.thisChunk is None:
            parser.error(
                "thisChunk must be specified when totalChunks is specified")

        if options.extra_mozinfo_json:
            if not os.path.isfile(options.extra_mozinfo_json):
                parser.error("Error: couldn't find mozinfo.json at '%s'."
                             % options.extra_mozinfo_json)

            options.extra_mozinfo_json = json.load(open(options.extra_mozinfo_json))

        if options.totalChunks:
            if not 1 <= options.thisChunk <= options.totalChunks:
                parser.error("thisChunk must be between 1 and totalChunks")

        if options.chunkByDir and options.chunkByRuntime:
            parser.error(
                "can only use one of --chunk-by-dir or --chunk-by-runtime")

        if options.xrePath is None:
            # default xrePath to the app path if not provided
            # but only if an app path was explicitly provided
            if options.app != parser.get_default('app'):
                options.xrePath = os.path.dirname(options.app)
                if mozinfo.isMac:
                    options.xrePath = os.path.join(
                        os.path.dirname(
                            options.xrePath),
                        "Resources")
            elif build_obj is not None:
                # otherwise default to dist/bin
                options.xrePath = build_obj.bindir
            else:
                parser.error(
                    "could not find xre directory, --xre-path must be specified")

        # allow relative paths
        if options.xrePath:
            options.xrePath = self.get_full_path(options.xrePath, parser.oldcwd)

        if options.profilePath:
            options.profilePath = self.get_full_path(options.profilePath, parser.oldcwd)

        if options.utilityPath:
            options.utilityPath = self.get_full_path(options.utilityPath, parser.oldcwd)

        if options.certPath:
            options.certPath = self.get_full_path(options.certPath, parser.oldcwd)
        elif build_obj:
            options.certPath = os.path.join(build_obj.topsrcdir, 'build', 'pgo', 'certs')

        if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
            options.symbolsPath = self.get_full_path(options.symbolsPath, parser.oldcwd)
        elif not options.symbolsPath and build_obj:
            options.symbolsPath = os.path.join(build_obj.distdir, 'crashreporter-symbols')

        if options.jsdebugger:
            options.extraPrefs += [
                "devtools.debugger.remote-enabled=true",
                "devtools.chrome.enabled=true",
                "devtools.debugger.prompt-connection=false"
            ]

        if options.debugOnFailure and not options.jsdebugger:
#.........这里部分代码省略.........
开发者ID:luke-chang,项目名称:gecko-1,代码行数:101,代码来源:mochitest_options.py

示例10: parseArgs


#.........这里部分代码省略.........
    args.tbversion = int(args.thunderbird)
    args.thunderbird = os.path.expanduser(config.require("paths", "thunderbird-%s" % args.tbversion))
    args.thunderbird = obmtool.utils.fixBinaryPath(args.thunderbird)
  except ValueError:
    # Otherwise it was probably a path. Keep the path in args.thunderbird and
    # get the version from Thunderbird's application.ini
    args.thunderbird = obmtool.utils.fixBinaryPath(os.path.expanduser(args.thunderbird))
    tbversion = mozversion.get_version(args.thunderbird)['application_version']
    args.tbversion = int(tbversion.split(".")[0])

  # Set up default lightning xpi based on either passed token (i.e tb3) or
  # passed thunderbird version
  if args.lightning and not os.path.exists(args.lightning):
    args.lightning = config.get("paths", "lightning-%s" % args.lightning)
    if args.lightning is None:
      print "Invalid path to Lightning XPI"
      sys.exit()
  if args.lightning is None:
    args.lightning = config.require("paths", "lightning-tb%d" % args.tbversion)

  # Set up default obm xpi based on either passed token (i.e next-tb17) or
  # default version in prefs (i.e obmversion=next-tb24)
  if args.obm is None:
    args.obm = config.require("defaults", "obmversion")
  if args.obm and not os.path.exists(args.obm):
    args.obm = config.require("paths", "obm-%s" % args.obm)

  logging.info("Using Lighting from %s" % args.lightning)
  logging.info("Using OBM from %s" % args.obm)

  # Set up a path for the profile, either from config or using /tmp
  args.cachePath = config.get("paths", "profileCache", None)
  if args.cachePath is None:
    args.cachePath = tempfile.gettempdir()

  # Expand user path for later use
  args.obm = os.path.expanduser(args.obm)
  args.lightning = os.path.expanduser(args.lightning)
  args.cachePath = os.path.expanduser(args.cachePath)

  # Add extra addons from prefs and passed options
  extensions = filter(bool, re.split("[,\n]", config.get("profile", "extensions", "")))
  extensions.extend(args.extension)
  extensions.append(args.obm)
  extensions.append(args.lightning)
  if args.mozmill:
    extensions.extend(mozmill.ADDONS)

  args.extension = map(os.path.expanduser, extensions)

  # Add extra preferences specified on commandline
  extraprefs = {}
  preferences = config.getAll("preferences")
  preferences.extend([x.split("=", 2) for x in args.pref])
  for k, v in preferences:
    lv = v.lower()
    if lv == "true":
      v = True
    elif lv == "false":
      v = False
    else:
      try: v = int(v)
      except: pass
    extraprefs[k] = v

  if args.mozmill:
    # Set up jsbridge port
    args.jsbridge_port = jsbridge.find_port()

    # Add testing prefs
    extraprefs['extensions.jsbridge.port'] = args.jsbridge_port
    extraprefs['focusmanager.testmode'] = True

    # TODO main window controller will timeout finding the main window since
    # the sync takes so long.
    extraprefs['extensions.obm.syncOnStart'] = False

    # Set up mozinfo for our current configuration
    mozinfo.update(obmtool.utils.setupMozinfo(args))

  # Set up extra preferences in the profile
  args.preferences = extraprefs

  # For the following args we need the runner already
  runner = createRunner(args)

  # Add extra certificates from the prefs
  for cert in filter(bool, re.split("[,\n]", config.get("profile", "certificates", ""))):
    host,port = cert.split(":")
    runner.profile.overrides.addEntry(host, int(port))

  # Add extra signons from the prefs
  for signon in filter(bool, re.split("[,\n]", config.get("profile", "signons", ""))):
    hostname,realm,user,password = signon.split("|")
    runner.profile.signons.addEntry(hostname, realm, user, password)

  # Need to flush profile after adding certs/signons
  runner.profile.flush()

  return runner, args
开发者ID:kewisch,项目名称:lightning-connector-automation,代码行数:101,代码来源:app.py


注:本文中的mozinfo.update函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。