update cmake_paths test
@@ -63,8 +63,19 @@ class CMakePathsGeneratorTest(unittest.TestCase):
conanfile.initialize(settings, EnvValues())
tmp = temp_folder()
cpp_info = CppInfo(tmp)
- cpp_info.name = "PkgUnusedName"
- cpp_info.names["cmake"] = "MyCMakePkgName"
+ cpp_info.name = "PkgCMakeName"
conanfile.deps_cpp_info.update(cpp_info, "pkg_reference_name")
generator = CMakePathsGenerator(conanfile)
- self.assertIn('set(CONAN_MYCMAKEPKGNAME_ROOT', generator.content)
+ self.assertIn('set(CONAN_PKGCMAKENAME_ROOT', generator.content)
+
+ def cpp_info_names_test(self):
+ settings = _MockSettings("Release")
+ conanfile = ConanFile(TestBufferConanOutput(), None)
+ conanfile.initialize(settings, EnvValues())
+ tmp = temp_folder()
+ cpp_info = CppInfo(tmp)
+ cpp_info.name = "PkgCMakeName"
+ cpp_info.names["cmake_paths"] = "MyCMakePathsPkgName"
+ conanfile.deps_cpp_info.update(cpp_info, "pkg_reference_name")
+ generator = CMakePathsGenerator(conanfile)
+ self.assertIn('set(CONAN_MYCMAKEPATHSPKGNAME_ROOT', generator.content)
