Skip to content

Commit dc55734

Browse files
committed
fix: Ensure local simplecpp executable is used in tests
This change ensures that the local simplecpp executable is used instead of any random executable found in the PATH. Suggested-by: firewave <firewave@users.noreply.github.com>
1 parent c1745eb commit dc55734

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

run-tests.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ def cleanup(out: str) -> str:
2626
if not GCC_EXE:
2727
sys.exit('Failed to run tests: gcc compiler not found')
2828

29-
# Check if simplecpp is in the PATH
30-
SIMPLECPP_EXE = shutil.which('simplecpp')
31-
# If not found in PATH, try current directory
32-
if not SIMPLECPP_EXE:
33-
candidate = os.path.join(os.getcwd(), "simplecpp")
34-
if os.path.isfile(candidate) and os.access(candidate, os.X_OK):
35-
SIMPLECPP_EXE = candidate
29+
# Ensure the local simplecpp executable is used
30+
SIMPLECPP_EXE = None
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
3634
if not SIMPLECPP_EXE:
3735
sys.exit('Failed to run tests: simplecpp compiler not found')
3836

0 commit comments

Comments
 (0)