def test_empty_version_string_is_rejected(self): """ Test that the empty stirng is not a valid version-string. """ parser = ClangVersionInfoParser() version_info = parser.parse('') self.assertFalse(version_info, False)
def test_binary_distribution_clang_7(self): """ Test that binary distribution of clang 7 version string is parsed correctly. """ with open('clang_7_bin_dist_version_output') as version_output: version_string = version_output.read() parser = ClangVersionInfoParser() version_info = parser.parse(version_string) self.assertIsNot(version_info, False) self.assertEqual(version_info.major_version, 7) self.assertEqual(version_info.minor_version, 0) self.assertEqual(version_info.patch_version, 0) self.assertEqual(version_info.installed_dir, '/path/to/clang/bin')
def test_built_from_source_clang_8(self): """ Test that source-built clang release_80 version string is parsed correctly. """ with open('clang_8_src_version_output') as version_output: version_string = version_output.read() parser = ClangVersionInfoParser() version_info = parser.parse(version_string) self.assertIsNot(version_info, False) self.assertEqual(version_info.major_version, 8) self.assertEqual(version_info.minor_version, 0) self.assertEqual(version_info.patch_version, 1) self.assertEqual(version_info.installed_dir, '/path/to/clang/bin')
def test_built_from_source_clang_7(self): """ Test that source-built clang release_70 version string is parsed correctly. """ with open('clang_7_src_version_output') as version_output: version_string = version_output.read() parser = ClangVersionInfoParser() version_info = parser.parse(version_string) self.assertIsNot(version_info, False) self.assertEqual(version_info.major_version, 7) self.assertEqual(version_info.minor_version, 1) self.assertEqual(version_info.patch_version, 0) self.assertEqual(version_info.target, 'x86_64-unknown-linux-gnu') self.assertEqual(version_info.thread_model, 'posix') self.assertEqual(version_info.installed_dir, '/path/to/clang/bin')