def test_visual_build_generator(self): builds = get_visual_builds(visual_versions=["10", "14"], archs=["x86"], visual_runtimes=["MDd", "MTd"], shared_option_name=None, dll_with_static_runtime=False, vs10_x86_64_enabled=True) expected = [ ({'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10', 'compiler.runtime': 'MTd'}, {}, {}, {}), ({'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10', 'compiler.runtime': 'MDd'}, {}, {}, {}), ({'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '14', 'compiler.runtime': 'MTd'}, {}, {}, {}), ({'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '14', 'compiler.runtime': 'MDd'}, {}, {}, {})] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MDd"], shared_option_name="libpng:shared", dll_with_static_runtime=True, vs10_x86_64_enabled=True) expected = [ ({'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10'}, {'libpng:shared': False}, {}, {}), ({'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10'}, {'libpng:shared': True}, {}, {}), ({'compiler.runtime': 'MDd', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10'}, {'libpng:shared': False}, {}, {}), ({'compiler.runtime': 'MDd', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10'}, {'libpng:shared': True}, {}, {})] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MDd"], shared_option_name="libpng:shared", dll_with_static_runtime=True, vs10_x86_64_enabled=False) expected = [ ({'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10'}, {'libpng:shared': False}, {}, {}), ({'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10'}, {'libpng:shared': True}, {}, {})] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MTd"], shared_option_name="libpng:shared", dll_with_static_runtime=False, vs10_x86_64_enabled=False) expected = [ ({'compiler': 'Visual Studio', 'compiler.runtime': 'MTd', 'compiler.version': '10', 'arch': 'x86', 'build_type': 'Debug'}, {'libpng:shared': False}, {}, {})] self.assertEquals([tuple(a) for a in builds], expected)
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)
def test_visual_build_generator(self): ref = ConanFileReference.loads("lib/1.0@conan/stable") builds = get_visual_builds(visual_versions=["10", "14"], archs=["x86"], visual_runtimes=["MDd", "MTd"], shared_option_name=None, dll_with_static_runtime=False, vs10_x86_64_enabled=True, build_types=["Debug", "Release"], reference=ref) expected = [({ 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10', 'compiler.runtime': 'MTd' }, {}, {}, {}, ref), ({ 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10', 'compiler.runtime': 'MDd' }, {}, {}, {}, ref), ({ 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '14', 'compiler.runtime': 'MTd' }, {}, {}, {}, ref), ({ 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '14', 'compiler.runtime': 'MDd' }, {}, {}, {}, ref)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MDd"], shared_option_name="libpng:shared", dll_with_static_runtime=True, vs10_x86_64_enabled=True, build_types=["Debug", "Release"]) expected = [({ 'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None), ({ 'compiler.runtime': 'MDd', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MDd', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MDd"], shared_option_name="libpng:shared", dll_with_static_runtime=True, vs10_x86_64_enabled=False, build_types=["Debug", "Release"]) expected = [({ 'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MTd"], shared_option_name="libpng:shared", dll_with_static_runtime=False, vs10_x86_64_enabled=False, build_types=["Debug", "Release"]) expected = [({ 'compiler': 'Visual Studio', 'compiler.runtime': 'MTd', 'compiler.version': '10', 'arch': 'x86', 'build_type': 'Debug' }, { 'libpng:shared': False }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10", "14"], archs=["x86"], visual_runtimes=["MDd", "MTd"], shared_option_name=None, dll_with_static_runtime=False, vs10_x86_64_enabled=True, build_types=["Debug"]) expected = [({ 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10', 'compiler.runtime': 'MTd' }, {}, {}, {}, None), ({ 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10', 'compiler.runtime': 'MDd' }, {}, {}, {}, None), ({ 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '14', 'compiler.runtime': 'MTd' }, {}, {}, {}, None), ({ 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '14', 'compiler.runtime': 'MDd' }, {}, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MDd"], shared_option_name="libpng:shared", dll_with_static_runtime=True, vs10_x86_64_enabled=True, build_types=["Debug"]) expected = [({ 'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None), ({ 'compiler.runtime': 'MDd', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MDd', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MDd"], shared_option_name="libpng:shared", dll_with_static_runtime=True, vs10_x86_64_enabled=False, build_types=["Debug"]) expected = [({ 'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MDd', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MTd"], shared_option_name="libpng:shared", dll_with_static_runtime=False, vs10_x86_64_enabled=False, build_types=["Debug"]) expected = [({ 'compiler': 'Visual Studio', 'compiler.runtime': 'MTd', 'compiler.version': '10', 'arch': 'x86', 'build_type': 'Debug' }, { 'libpng:shared': False }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) ############# builds = get_visual_builds(visual_versions=["10", "14"], archs=["x86_64"], visual_runtimes=["MD", "MT"], shared_option_name=None, dll_with_static_runtime=False, vs10_x86_64_enabled=True, build_types=["Release"]) expected = [({ 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '10', 'compiler.runtime': 'MT' }, {}, {}, {}, None), ({ 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '10', 'compiler.runtime': 'MD' }, {}, {}, {}, None), ({ 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '14', 'compiler.runtime': 'MT' }, {}, {}, {}, None), ({ 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '14', 'compiler.runtime': 'MD' }, {}, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MD"], shared_option_name="libpng:shared", dll_with_static_runtime=True, vs10_x86_64_enabled=True, build_types=["Release"]) expected = [({ 'compiler.runtime': 'MD', 'arch': 'x86', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MD', 'arch': 'x86', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None), ({ 'compiler.runtime': 'MD', 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MD', 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MD"], shared_option_name="libpng:shared", dll_with_static_runtime=True, vs10_x86_64_enabled=False, build_types=["Release"]) expected = [({ 'compiler.runtime': 'MD', 'arch': 'x86', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': False }, {}, {}, None), ({ 'compiler.runtime': 'MD', 'arch': 'x86', 'build_type': 'Release', 'compiler': 'Visual Studio', 'compiler.version': '10' }, { 'libpng:shared': True }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected) builds = get_visual_builds(visual_versions=["10"], archs=["x86", "x86_64"], visual_runtimes=["MT"], shared_option_name="libpng:shared", dll_with_static_runtime=False, vs10_x86_64_enabled=False, build_types=["Release"]) expected = [({ 'compiler': 'Visual Studio', 'compiler.runtime': 'MT', 'compiler.version': '10', 'arch': 'x86', 'build_type': 'Release' }, { 'libpng:shared': False }, {}, {}, None)] self.assertEquals([tuple(a) for a in builds], expected)