-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathci_test_example.py
36 lines (26 loc) · 1.34 KB
/
ci_test_example.py
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
33
34
35
36
import platform
from test.examples_tools import chdir, run
if platform.system() == "Linux":
with chdir("toolchain"):
run("conan create . -pr:b=default -pr:h=../profiles/raspberry-64 --build-require")
with chdir("consumer"):
run("conan install . --build missing -pr:b=default -pr:h=../profiles/raspberry-64 -pr:h=../profiles/arm-toolchain")
generators_folder = "Release/generators"
with chdir("consumer/build"):
command = []
# in the conanfile.py we only add CMake as tool_require in Linux
command.append(f". {generators_folder}/conanbuild.sh")
command.append(f"cmake .. -DCMAKE_TOOLCHAIN_FILE={generators_folder}/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release")
command.append("cmake --build .")
command.append(f". {generators_folder}/deactivate_conanbuild.sh")
run(" && ".join(command))
cmd_out = run("file compressor")
assert "ELF 64-bit" in cmd_out
run("rm -rf ./consumer/build")
with chdir("consumer"):
run("conan install . --build missing -pr:b=default -pr:h=../profiles/raspberry-64 -pr:h=../profiles/arm-toolchain")
run("cmake --preset conan-release")
run("cmake --build --preset conan-release")
with chdir("consumer/build/Release"):
cmd_out = run("file compressor")
assert "ELF 64-bit" in cmd_out