Skip to content

Commit 8985b63

Browse files
committed
Move Conan Test Example Files
1 parent 464cdb8 commit 8985b63

File tree

4 files changed

+40
-25
lines changed

4 files changed

+40
-25
lines changed

examples/conan_cmake/library_consumer/CMakeLists.txt renamed to examples/conan_cmake/library/test_package/CMakeLists.txt

File renamed without changes.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""Test package for mathutils library."""
2+
3+
import os
4+
5+
from conan import ConanFile
6+
from conan.tools.build import can_run
7+
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
8+
9+
10+
class MathUtilsTestConan(ConanFile):
11+
"""Test package for mathutils library."""
12+
13+
settings = 'os', 'compiler', 'build_type', 'arch'
14+
15+
def requirements(self):
16+
"""Add the tested package as a requirement."""
17+
self.requires(self.tested_reference_str)
18+
19+
def layout(self):
20+
"""Set the CMake layout."""
21+
cmake_layout(self)
22+
23+
def generate(self):
24+
"""Generate CMake dependencies and toolchain."""
25+
deps = CMakeDeps(self)
26+
deps.generate()
27+
tc = CMakeToolchain(self)
28+
tc.generate()
29+
30+
def build(self):
31+
"""Build the test package."""
32+
cmake = CMake(self)
33+
cmake.configure()
34+
cmake.build()
35+
36+
def test(self):
37+
"""Run the test."""
38+
if can_run(self):
39+
cmd = os.path.join(self.cpp.build.bindir, 'consumer')
40+
self.run(cmd, env='conanrun')
File renamed without changes.

examples/conan_cmake/library_consumer/pyproject.toml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)