def test_common_options_full(self): args = self.default_args() args.enable_asan = True args.enable_ubsan = True args.export_compile_commands = True args.distcc = True args.cmake_generator = 'Xcode' args.clang_user_visible_version = Version("9.0.0") args.clang_compiler_version = Version("999.0.900") args.build_ninja = True cmake = self.cmake(args) self.assertEqual( list(cmake.common_options()), ["-G", "Xcode", "-DLLVM_USE_SANITIZER=Address;Undefined", "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", "-DCMAKE_C_COMPILER_LAUNCHER:PATH=" + self.mock_distcc_path(), "-DCMAKE_CXX_COMPILER_LAUNCHER:PATH=" + self.mock_distcc_path(), "-DCMAKE_C_COMPILER:PATH=/path/to/clang", "-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++", "-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc", "-DCMAKE_LIBTOOL:PATH=/path/to/libtool", "-DCMAKE_AR:PATH=/path/to/ar", "-DCMAKE_CONFIGURATION_TYPES=" + "Debug;Release;MinSizeRel;RelWithDebInfo", "-DLLVM_VERSION_MAJOR:STRING=9", "-DLLVM_VERSION_MINOR:STRING=0", "-DLLVM_VERSION_PATCH:STRING=0", "-DCLANG_VERSION_MAJOR:STRING=9", "-DCLANG_VERSION_MINOR:STRING=0", "-DCLANG_VERSION_PATCH:STRING=0"])
def test_common_options_clang_compiler_version(self): args = self.default_args() args.clang_compiler_version = Version("999.0.999") cmake = self.cmake(args) self.assertEqual(list(cmake.common_options()), [ "-G", "Ninja", "-DCMAKE_C_COMPILER:PATH=/path/to/clang", "-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++", "-DCMAKE_LIBTOOL:PATH=/path/to/libtool", "-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args) ])
def test_common_options_clang_user_visible_version(self): args = self.default_args() args.clang_user_visible_version = Version("9.0.0") cmake = self.cmake(args) self.assertEqual(list(cmake.common_options()), [ "-G", "Ninja", "-DCMAKE_C_COMPILER:PATH=/path/to/clang", "-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++", "-DCMAKE_LIBTOOL:PATH=/path/to/libtool", "-DLLVM_VERSION_MAJOR:STRING=9", "-DLLVM_VERSION_MINOR:STRING=0", "-DLLVM_VERSION_PATCH:STRING=0", "-DCLANG_VERSION_MAJOR:STRING=9", "-DCLANG_VERSION_MINOR:STRING=0", "-DCLANG_VERSION_PATCH:STRING=0", "-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args) ])