-
Notifications
You must be signed in to change notification settings - Fork 998
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/markdown cmake gen info (#7690)
* #7525 Show filenames in json Signed-off-by: Uilian Ries <uilianries@gmail.com> * #7525 Add basic test for markdown generator Signed-off-by: Uilian Ries <uilianries@gmail.com> * #7525 Re-use jinja instance Signed-off-by: Uilian Ries <uilianries@gmail.com> * #7525 Fix cmake find package name Signed-off-by: Uilian Ries <uilianries@gmail.com>
- Loading branch information
1 parent
1fd02ef
commit 436450e
Showing
4 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import textwrap | ||
import unittest | ||
|
||
from conans.test.utils.tools import TestClient | ||
from conans.client.tools.files import load | ||
|
||
|
||
class MarkDownGeneratorTest(unittest.TestCase): | ||
|
||
def test_cmake_find_filename(self): | ||
conanfile = textwrap.dedent(""" | ||
from conans import ConanFile | ||
class HelloConan(ConanFile): | ||
def package_info(self): | ||
self.cpp_info.filenames['cmake_find_package'] = 'FooBar' | ||
self.cpp_info.names['cmake_find_package'] = 'foobar' | ||
self.cpp_info.names['cmake_find_package_multi'] = 'foobar_multi' | ||
self.cpp_info.names['pkg_config'] = 'foobar_cfg' | ||
""") | ||
client = TestClient() | ||
client.save({"conanfile.py": conanfile}) | ||
client.run("create . bar/0.1.0@user/testing") | ||
client.run("install bar/0.1.0@user/testing -g markdown") | ||
content = client.load("bar.md") | ||
|
||
self.assertIn("Generates the file FindFooBar.cmake", content) | ||
self.assertIn("find_package(FooBar)", content) |