11"""TODO"""
22
3+ import os
34import subprocess
45
56from 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