Ejemplo n.º 1
0
    def test_string(self):
        CompilerType = EnumString.subclass('gcc', 'clang', 'clang-cl')

        type = CompilerType('gcc')
        self.assertEquals(type, 'gcc')
        self.assertNotEquals(type, 'clang')
        self.assertNotEquals(type, 'clang-cl')
        self.assertIn(type, ('gcc', 'clang-cl'))
        self.assertNotIn(type, ('clang', 'clang-cl'))

        with self.assertRaises(EnumStringComparisonError):
            self.assertEquals(type, 'foo')

        with self.assertRaises(EnumStringComparisonError):
            self.assertNotEquals(type, 'foo')

        with self.assertRaises(EnumStringComparisonError):
            self.assertIn(type, ('foo', 'gcc'))

        with self.assertRaises(ValueError):
            type = CompilerType('foo')
Ejemplo n.º 2
0
    def test_string(self):
        CompilerType = EnumString.subclass("gcc", "clang", "clang-cl")

        type = CompilerType("gcc")
        self.assertEquals(type, "gcc")
        self.assertNotEquals(type, "clang")
        self.assertNotEquals(type, "clang-cl")
        self.assertIn(type, ("gcc", "clang-cl"))
        self.assertNotIn(type, ("clang", "clang-cl"))

        with self.assertRaises(EnumStringComparisonError):
            self.assertEquals(type, "foo")

        with self.assertRaises(EnumStringComparisonError):
            self.assertNotEquals(type, "foo")

        with self.assertRaises(EnumStringComparisonError):
            self.assertIn(type, ("foo", "gcc"))

        with self.assertRaises(ValueError):
            type = CompilerType("foo")
Ejemplo n.º 3
0
    def test_string(self):
        CompilerType = EnumString.subclass('msvc', 'gcc', 'clang', 'clang-cl')

        type = CompilerType('msvc')
        self.assertEquals(type, 'msvc')
        self.assertNotEquals(type, 'gcc')
        self.assertNotEquals(type, 'clang')
        self.assertNotEquals(type, 'clang-cl')
        self.assertIn(type, ('msvc', 'clang-cl'))
        self.assertNotIn(type, ('gcc', 'clang'))

        with self.assertRaises(EnumStringComparisonError):
            self.assertEquals(type, 'foo')

        with self.assertRaises(EnumStringComparisonError):
            self.assertNotEquals(type, 'foo')

        with self.assertRaises(EnumStringComparisonError):
            self.assertIn(type, ('foo', 'gcc'))

        with self.assertRaises(ValueError):
            type = CompilerType('foo')
Ejemplo n.º 4
0
# 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

from mozbuild.util import EnumString
from collections import OrderedDict

CompilerType = EnumString.subclass(
    "clang",
    "clang-cl",
    "gcc",
    "msvc",
)

OS = EnumString.subclass(
    "Android",
    "DragonFly",
    "FreeBSD",
    "GNU",
    "NetBSD",
    "OpenBSD",
    "OSX",
    "SunOS",
    "WINNT",
    "WASI",
)

Kernel = EnumString.subclass(
    "Darwin",
Ejemplo n.º 5
0
# 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

from mozbuild.util import EnumString
from collections import OrderedDict


CompilerType = EnumString.subclass(
    'clang',
    'clang-cl',
    'gcc',
    'msvc',
)

OS = EnumString.subclass(
    'Android',
    'DragonFly',
    'FreeBSD',
    'GNU',
    'iOS',
    'NetBSD',
    'OpenBSD',
    'OSX',
    'WINNT',
)

Kernel = EnumString.subclass(
    'Darwin',
Ejemplo n.º 6
0
# 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

from mozbuild.util import EnumString
from collections import OrderedDict


CompilerType = EnumString.subclass(
    'clang',
    'clang-cl',
    'gcc',
    'msvc',
)

OS = EnumString.subclass(
    'Android',
    'DragonFly',
    'FreeBSD',
    'GNU',
    'iOS',
    'NetBSD',
    'OpenBSD',
    'OSX',
    'WINNT',
)

Kernel = EnumString.subclass(
    'Darwin',
Ejemplo n.º 7
0
# 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

from mozbuild.util import EnumString
from collections import OrderedDict

CompilerType = EnumString.subclass(
    'clang',
    'clang-cl',
    'gcc',
    'msvc',
)

OS = EnumString.subclass(
    'Android',
    'DragonFly',
    'FreeBSD',
    'GNU',
    'iOS',
    'NetBSD',
    'OpenBSD',
    'OSX',
    'WINNT',
)

Kernel = EnumString.subclass(
    'Darwin',
    'DragonFly',