python/mozbuild/mozbuild/test/configure/test_toolkit_moz_configure.py
author Nicholas Hurley <hurley@mozilla.com>
Thu, 17 Aug 2017 17:30:57 -0700
changeset 427990 ce6e2f914c96563ef4d4b2dd2bb10fe1b9fd2a33
parent 416802 511c4f11a455019c050d9cfec9191dfcec47b74a
child 473694 05400e59a489907c2efdabb31d747eee56a79905
permissions -rw-r--r--
Bug 1391467 - Remove --enable-necko-protocols. r=gps,valentin This patch removes the ability to select which protocols you want included in necko, a wholly untested configuration that is broken in practice. We have no need of this kind of configurability in necko. In addition, this removes the final vestiges of rtsp support, which was originally removed in bug 1295885 but still had some stuff hanging around behind some ifdefs (that were never true). MozReview-Commit-ID: KOEaDmit2IL

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import absolute_import, print_function, unicode_literals

import os

from buildconfig import topsrcdir
from common import BaseConfigureTest
from mozunit import main
from mozbuild.configure.options import InvalidOptionError


class TestToolkitMozConfigure(BaseConfigureTest):
    def test_developer_options(self):
        def get_value(args=[], environ={}):
            sandbox = self.get_sandbox({}, {}, args, environ)
            return sandbox._value_for(sandbox['developer_options'])

        self.assertEqual(get_value(), True)

        self.assertEqual(get_value(['--enable-release']), None)

        self.assertEqual(get_value(environ={'MOZILLA_OFFICIAL': 1}), None)

        self.assertEqual(get_value(['--enable-release'],
                         environ={'MOZILLA_OFFICIAL': 1}), None)

        with self.assertRaises(InvalidOptionError):
            get_value(['--disable-release'], environ={'MOZILLA_OFFICIAL': 1})

        self.assertEqual(get_value(environ={'MOZ_AUTOMATION': 1}), None)


if __name__ == '__main__':
    main()