Skip to content

Commit 5b91c20

Browse files
committed
Add OS envrion
1 parent 886b922 commit 5b91c20

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

cppython/plugins/conan/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def sync_data(self, consumer: SyncConsumer) -> SyncData:
9898
if sync_type == CMakeSyncData:
9999
return CMakeSyncData(
100100
provider_name=TypeName('conan'),
101-
top_level_includes=self.core_data.cppython_data.tool_path / 'conan' / 'conan_provider.cmake',
101+
top_level_includes=self.core_data.cppython_data.install_path / 'conan_provider.cmake',
102102
)
103103

104104
raise NotSupportedError('OOF')

tests/integration/examples/test_conan_cmake.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""TODO"""
22

3+
import os
34
import subprocess
45

56
from typer.testing import CliRunner
@@ -25,18 +26,24 @@ def test_simple(example_runner: CliRunner) -> None:
2526
assert result.exit_code == 0, result.output
2627

2728
# Run the CMake configuration command
28-
cmake_result = subprocess.run(['cmake', '--preset=default'], capture_output=True, text=True, check=False)
29+
cmake_result = subprocess.run(
30+
['cmake', '--preset=default'], capture_output=True, text=True, check=False, env=os.environ
31+
)
2932

3033
assert cmake_result.returncode == 0, f'CMake configuration failed: {cmake_result.stderr}'
3134

3235
# Run the CMake build command
33-
build_result = subprocess.run(['cmake', '--build', 'build'], capture_output=True, text=True, check=False)
36+
build_result = subprocess.run(
37+
['cmake', '--build', 'build'], capture_output=True, text=True, check=False, env=os.environ
38+
)
3439

3540
assert build_result.returncode == 0, f'CMake build failed: {build_result.stderr}'
3641
assert 'Build finished successfully' in build_result.stdout, 'CMake build did not finish successfully'
3742

3843
# Execute the built program and verify the output
39-
program_result = subprocess.run(['build/HelloWorld'], capture_output=True, text=True, check=False)
44+
program_result = subprocess.run(
45+
['build/HelloWorld'], capture_output=True, text=True, check=False, env=os.environ
46+
)
4047

4148
assert program_result.returncode == 0, f'Program execution failed: {program_result.stderr}'
4249

0 commit comments

Comments
 (0)