forked from conan-io/examples2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci_test_example.py
More file actions
32 lines (27 loc) · 1.29 KB
/
ci_test_example.py
File metadata and controls
32 lines (27 loc) · 1.29 KB
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
31
32
import platform
from test.examples_tools import chdir, run
if platform.system() == "Windows":
# Build for Release and Debug with static libraries
run("conan install . --output-folder=build --build=missing")
with chdir("build"):
command = []
command.append("conanbuild.bat")
command.append("cmake .. -G \"Visual Studio 17 2022\" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake")
command.append("deactivate_conanbuild.bat")
command.append("cmake --build . --config Release")
cmd_out = run(" && ".join(command))
assert "Building with CMake version: 3.27.9" in cmd_out
cmd_out = run("Release\\compressor.exe")
assert "ZLIB VERSION: 1.3.1" in cmd_out
else:
run("conan install . --output-folder=cmake-build-release --build=missing")
with chdir("cmake-build-release"):
command = []
command.append(". ./conanbuild.sh")
command.append("cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release")
command.append(". ./deactivate_conanbuild.sh")
command.append("cmake --build .")
cmd_out = run(" && ".join(command))
assert "Building with CMake version: 3.27.9" in cmd_out
cmd_out = run("./compressor")
assert "ZLIB VERSION: 1.3.1" in cmd_out