File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import ast
4+ import os
45import subprocess
56import tempfile
67import time
@@ -63,6 +64,13 @@ def generate_concolic_tests(
6364 logger .info ("Generating concolic opcode coverage tests for the original code…" )
6465 console .rule ()
6566 try :
67+ env = os .environ .copy ()
68+ pythonpath = env .get ("PYTHONPATH" , "" )
69+ project_root_str = str (args .project_root )
70+ if pythonpath :
71+ env ["PYTHONPATH" ] = f"{ project_root_str } { os .pathsep } { pythonpath } "
72+ else :
73+ env ["PYTHONPATH" ] = project_root_str
6674 cover_result = subprocess .run (
6775 [
6876 SAFE_SYS_EXECUTABLE ,
@@ -86,6 +94,7 @@ def generate_concolic_tests(
8694 cwd = args .project_root ,
8795 check = False ,
8896 timeout = 600 ,
97+ env = env ,
8998 )
9099 except subprocess .TimeoutExpired :
91100 logger .debug ("CrossHair Cover test generation timed out" )
You can’t perform that action at this time.
0 commit comments