Skip to content

Commit

Permalink
Using regex instead of literal Path.cwd()
Browse files Browse the repository at this point in the history
  • Loading branch information
franramirez688 committed Sep 22, 2023
1 parent fdd94cb commit c451fef
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import platform
import re
import shutil
import subprocess
import tempfile
Expand Down Expand Up @@ -293,20 +294,18 @@ def test_propagate_non_default_compiler(self, capfd, chdir_build):
assert 'tools.build:compiler_executables={"c":"/usr/bin/clang","cpp":"/usr/bin/clang++"}' in out

class TestProfileCustomization:
def test_profile_defults(self, capfd, chdir_build):
def test_profile_defaults(self, capfd, chdir_build):
"""Test the defaults passed for host and build profiles"""
run(f"cmake --fresh .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DCMAKE_BUILD_TYPE=Release", check=True)
builddir = str(Path.cwd()).replace('\\','/')
out, _ = capfd.readouterr()
assert f"--profile:host={builddir}/conan_host_profile" in out
assert re.search("--profile:host=.*/build/conan_host_profile", out) # buildir
assert "--profile:build=default" in out

def test_profile_composed_list(self, capfd, chdir_build):
"""Test passing a list of profiles to host and build profiles"""
run(f'cmake --fresh .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DCMAKE_BUILD_TYPE=Release -DCONAN_HOST_PROFILE="autodetect;foo" -DCONAN_BUILD_PROFILE="default;bar"', check=True)
builddir = str(Path.cwd()).replace('\\','/')
out, err = capfd.readouterr()
assert f"--profile:host={builddir}/conan_host_profile" in out
assert re.search("--profile:host=.*/build/conan_host_profile", out) # buildir
assert "--profile:host=foo" in out
assert "user:custom_info=foo" in err
assert "--profile:build=default" in out
Expand Down

0 comments on commit c451fef

Please sign in to comment.