Skip to content

Commit 50d160d

Browse files
committed
chore: Improve tool detection in test script
Suggested-by: firewave <firewave@users.noreply.github.com>
1 parent a7841d8 commit 50d160d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

run-tests.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ def cleanup(out):
2424
if not GCC_EXE:
2525
sys.exit('Failed to run tests: gcc compiler not found')
2626

27-
os.environ["PATH"] = os.getcwd() + os.pathsep + os.environ["PATH"]
27+
# Check if simplecpp is in the PATH
2828
SIMPLECPP_EXE = shutil.which('simplecpp')
29+
# If not found in PATH, try current directory
30+
if not SIMPLECPP_EXE:
31+
candidate = os.path.join(os.getcwd(), "simplecpp")
32+
if os.path.isfile(candidate) and os.access(candidate, os.X_OK):
33+
SIMPLECPP_EXE = candidate
2934
if not SIMPLECPP_EXE:
3035
sys.exit('Failed to run tests: simplecpp compiler not found')
3136

0 commit comments

Comments
 (0)