Skip to content

Commit

Permalink
fix: test os version
Browse files Browse the repository at this point in the history
  • Loading branch information
ErniGH committed Mar 18, 2024
1 parent c0a6fa7 commit 1479d94
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,24 @@ def test_os_version(self, capfd, basic_cmake_project):
"-DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15")
out, _ = capfd.readouterr()
assert "os.version=10.15" in out
# Simulates a second execution to see if the cache variable is working
run(f"cmake -S {source_dir} -B {binary_dir} -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES={conan_provider} "
"-DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15")
out, _ = capfd.readouterr()
assert "os.version=10.15" in out

def test_no_os_version(self, capfd, basic_cmake_project):
"If CMAKE_OSX_DEPLOYMENT_TARGET is not set, os.version is not added to the Conan profile"
source_dir, binary_dir = basic_cmake_project
run(f"cmake -S {source_dir} -B {binary_dir} -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES={conan_provider} "
"-DCMAKE_BUILD_TYPE=Release")
out, _ = capfd.readouterr()
assert "os.version=10.15" not in out
assert "os.version=" not in out
# Simulates a second execution to see if the cache variable is working
run(f"cmake -S {source_dir} -B {binary_dir} -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES={conan_provider} "
"-DCMAKE_BUILD_TYPE=Release")
out, _ = capfd.readouterr()
assert "os.version=" not in out

class TestAndroid:
def test_android_armv8(self, capfd, basic_cmake_project):
Expand Down

0 comments on commit 1479d94

Please sign in to comment.