Skip to content

Commit

Permalink
Add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrobins committed Jul 18, 2023
1 parent 4a4794a commit 7a76da3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/resources/cmake_module/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.24)
project(MyApp CXX)

set(CMAKE_CXX_STANDARD 17)
find_package(Threads REQUIRED)
14 changes: 14 additions & 0 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ def test_reconfigure_on_conanfile_changes(self, capfd, chdir_build):
assert all(expected in out for expected in expected_conan_install_outputs)


class TestCmakeModule:
@pytest.fixture(scope="class", autouse=True)
def cmake_module_setup(self):
src_dir = Path(__file__).parent.parent
shutil.copytree(src_dir / 'tests' / 'resources' / 'cmake_module', ".", dirs_exist_ok=True)
yield

def test_cmake_module(self, capfd, chdir_build):
"Ensure that the Find<PackageName>.cmake modules from the CMake install work"
run("cmake .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DCMAKE_BUILD_TYPE=Release")
out, _ = capfd.readouterr()
assert "Found Threads: TRUE" in out


class TestSubdir:
@pytest.fixture(scope="class", autouse=True)
def subdir_setup(self):
Expand Down

0 comments on commit 7a76da3

Please sign in to comment.