aboutsummaryrefslogtreecommitdiff
path: root/test_package/conanfile.py
blob: 403e35710a3b7b59801d875a9e5a9c1bfcfbebc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os

from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
from conan.tools.build import can_run


class WandaTestConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires(self.tested_reference_str)

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()

    def layout(self):
        cmake_layout(self)

    def test(self):
        if not can_run(self):
            return

        self.run("wandad -h", env="conanrun")
        self.run("wandac -h", env="conanrun")
        cmd = os.path.join(self.cpp.build.bindir, "test")
        self.run(cmd, env="conanrun")