Example #1
0
    def test_get_linux_clang_builds(self):
        builds = get_linux_clang_builds(["4.0"], ["x86_64"], "pack:shared", pure_c=False)
        expected = [({'compiler': 'clang', 'build_type': 'Debug', 'compiler.libcxx': 'libstdc++', 'compiler.version': '4.0', 'arch': 'x86_64'},
                     {'pack:shared': True}, {}, {}),
                    ({'compiler': 'clang', 'build_type': 'Debug', 'compiler.libcxx': 'libc++', 'compiler.version': '4.0', 'arch': 'x86_64'},
                     {'pack:shared': True}, {}, {}),
                    ({'compiler': 'clang', 'build_type': 'Release', 'compiler.libcxx': 'libstdc++', 'compiler.version': '4.0', 'arch': 'x86_64'},
                     {'pack:shared': True}, {}, {}),
                    ({'compiler': 'clang', 'build_type': 'Release', 'compiler.libcxx': 'libc++', 'compiler.version': '4.0', 'arch': 'x86_64'},
                     {'pack:shared': True}, {}, {}),
                    ({'compiler': 'clang', 'build_type': 'Debug', 'compiler.libcxx': 'libstdc++', 'compiler.version': '4.0', 'arch': 'x86_64'},
                     {'pack:shared': False}, {}, {}),
                    ({'compiler': 'clang', 'build_type': 'Debug', 'compiler.libcxx': 'libc++', 'compiler.version': '4.0', 'arch': 'x86_64'},
                     {'pack:shared': False}, {}, {}),
                    ({'compiler': 'clang', 'build_type': 'Release', 'compiler.libcxx': 'libstdc++', 'compiler.version': '4.0', 'arch': 'x86_64'},
                     {'pack:shared': False}, {}, {}),
                    ({'compiler': 'clang', 'build_type': 'Release', 'compiler.libcxx': 'libc++', 'compiler.version': '4.0', 'arch': 'x86_64'},
                     {'pack:shared': False}, {}, {})]
        self.assertEquals([tuple(a) for a in builds], expected)

        builds = get_linux_clang_builds(["4.0"], ["x86_64"], "pack:shared", pure_c=True)
        expected = [({'arch': 'x86_64', 'compiler.version': '4.0', 'build_type': 'Debug', 'compiler': 'clang'},
                     {'pack:shared': True}, {}, {}),
                    ({'arch': 'x86_64', 'compiler.version': '4.0', 'build_type': 'Release', 'compiler': 'clang'},
                     {'pack:shared': True}, {}, {}),
                    ({'arch': 'x86_64', 'compiler.version': '4.0', 'build_type': 'Debug', 'compiler': 'clang'},
                     {'pack:shared': False}, {}, {}),
                    ({'arch': 'x86_64', 'compiler.version': '4.0', 'build_type': 'Release', 'compiler': 'clang'},
                     {'pack:shared': False}, {}, {})]
        self.assertEquals([tuple(a) for a in builds], expected)
Example #2
0
    def add_common_builds(self,
                          shared_option_name=None,
                          pure_c=True,
                          dll_with_static_runtime=False,
                          reference=None):

        reference = reference or self.reference

        builds = []
        if self.use_docker:
            builds = get_linux_gcc_builds(self.gcc_versions, self.archs,
                                          shared_option_name, pure_c,
                                          self.build_types, reference)
            builds.extend(
                get_linux_clang_builds(self.clang_versions, self.archs,
                                       shared_option_name, pure_c,
                                       self.build_types, reference))
        else:
            if self._platform_info.system() == "Windows":
                if self.mingw_configurations:
                    builds = get_mingw_builds(self.mingw_configurations,
                                              self.mingw_installer_reference,
                                              self.archs, shared_option_name,
                                              self.build_types, reference)
                builds.extend(
                    get_visual_builds(self.visual_versions, self.archs,
                                      self.visual_runtimes, shared_option_name,
                                      dll_with_static_runtime,
                                      self.vs10_x86_64_enabled,
                                      self.build_types, reference))
            elif self._platform_info.system() == "Linux":
                builds = get_linux_gcc_builds(self.gcc_versions, self.archs,
                                              shared_option_name, pure_c,
                                              self.build_types, reference)
                builds.extend(
                    get_linux_clang_builds(self.clang_versions, self.archs,
                                           shared_option_name, pure_c,
                                           self.build_types, reference))
            elif self._platform_info.system() == "Darwin":
                builds = get_osx_apple_clang_builds(self.apple_clang_versions,
                                                    self.archs,
                                                    shared_option_name, pure_c,
                                                    self.build_types,
                                                    reference)
            elif self._platform_info.system() == "FreeBSD":
                builds = get_linux_clang_builds(self.clang_versions,
                                                self.archs, shared_option_name,
                                                pure_c, self.build_types,
                                                reference)

        self._builds.extend(builds)
Example #3
0
    def test_get_linux_clang_builds(self):
        self.maxDiff = None
        ref = ConanFileReference.loads("lib/2.3@conan/stable")
        builds = get_linux_clang_builds(["4.0"], ["x86_64"],
                                        "pack:shared",
                                        pure_c=False,
                                        build_types=["Debug", "Release"],
                                        reference=ref)
        expected = [({
            'compiler': 'clang',
            'build_type': 'Debug',
            'compiler.libcxx': 'libstdc++',
            'compiler.version': '4.0',
            'arch': 'x86_64'
        }, {
            'pack:shared': True
        }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Debug',
                        'compiler.libcxx': 'libc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': True
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Release',
                        'compiler.libcxx': 'libstdc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': True
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Release',
                        'compiler.libcxx': 'libc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': True
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Debug',
                        'compiler.libcxx': 'libstdc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Debug',
                        'compiler.libcxx': 'libc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Release',
                        'compiler.libcxx': 'libstdc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Release',
                        'compiler.libcxx': 'libc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref)]
        b = [tuple(a) for a in builds]
        self.assertEquals(b, expected)

        builds = get_linux_clang_builds(["4.0"], ["x86_64"],
                                        "pack:shared",
                                        pure_c=True,
                                        build_types=["Debug", "Release"],
                                        reference=ref)
        expected = [({
            'arch': 'x86_64',
            'compiler.version': '4.0',
            'build_type': 'Debug',
            'compiler': 'clang'
        }, {
            'pack:shared': True
        }, {}, {}, ref),
                    ({
                        'arch': 'x86_64',
                        'compiler.version': '4.0',
                        'build_type': 'Release',
                        'compiler': 'clang'
                    }, {
                        'pack:shared': True
                    }, {}, {}, ref),
                    ({
                        'arch': 'x86_64',
                        'compiler.version': '4.0',
                        'build_type': 'Debug',
                        'compiler': 'clang'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref),
                    ({
                        'arch': 'x86_64',
                        'compiler.version': '4.0',
                        'build_type': 'Release',
                        'compiler': 'clang'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref)]
        self.assertEquals([tuple(a) for a in builds], expected)

        builds = get_linux_clang_builds(["4.0"], ["x86_64"],
                                        "pack:shared",
                                        pure_c=False,
                                        build_types=["Debug"],
                                        reference=ref)
        expected = [({
            'compiler': 'clang',
            'build_type': 'Debug',
            'compiler.libcxx': 'libstdc++',
            'compiler.version': '4.0',
            'arch': 'x86_64'
        }, {
            'pack:shared': True
        }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Debug',
                        'compiler.libcxx': 'libc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': True
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Debug',
                        'compiler.libcxx': 'libstdc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Debug',
                        'compiler.libcxx': 'libc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref)]
        self.assertEquals([tuple(a) for a in builds], expected)

        builds = get_linux_clang_builds(["4.0"], ["x86_64"],
                                        "pack:shared",
                                        pure_c=True,
                                        build_types=["Debug"],
                                        reference=ref)
        expected = [({
            'arch': 'x86_64',
            'compiler.version': '4.0',
            'build_type': 'Debug',
            'compiler': 'clang'
        }, {
            'pack:shared': True
        }, {}, {}, ref),
                    ({
                        'arch': 'x86_64',
                        'compiler.version': '4.0',
                        'build_type': 'Debug',
                        'compiler': 'clang'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref)]
        self.assertEquals([tuple(a) for a in builds], expected)

        builds = get_linux_clang_builds(["4.0"], ["x86_64"],
                                        "pack:shared",
                                        pure_c=False,
                                        build_types=["Release"],
                                        reference=ref)
        expected = [({
            'compiler': 'clang',
            'build_type': 'Release',
            'compiler.libcxx': 'libstdc++',
            'compiler.version': '4.0',
            'arch': 'x86_64'
        }, {
            'pack:shared': True
        }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Release',
                        'compiler.libcxx': 'libc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': True
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Release',
                        'compiler.libcxx': 'libstdc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref),
                    ({
                        'compiler': 'clang',
                        'build_type': 'Release',
                        'compiler.libcxx': 'libc++',
                        'compiler.version': '4.0',
                        'arch': 'x86_64'
                    }, {
                        'pack:shared': False
                    }, {}, {}, ref)]
        self.assertEquals([tuple(a) for a in builds], expected)

        builds = get_linux_clang_builds(["4.0"], ["x86_64"],
                                        "pack:shared",
                                        pure_c=True,
                                        build_types=["Release"],
                                        reference=None)
        expected = [({
            'arch': 'x86_64',
            'compiler.version': '4.0',
            'build_type': 'Release',
            'compiler': 'clang'
        }, {
            'pack:shared': True
        }, {}, {}, None),
                    ({
                        'arch': 'x86_64',
                        'compiler.version': '4.0',
                        'build_type': 'Release',
                        'compiler': 'clang'
                    }, {
                        'pack:shared': False
                    }, {}, {}, None)]
        self.assertEquals([tuple(a) for a in builds], expected)