Skip to content

Commit d4ff563

Browse files
authored
Fix #767 (CI: run run-tests.py on windows) (#768)
1 parent 3ed6a6f commit d4ff563

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎.github/workflows/CI-windows.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ jobs:
7171
set SIMPLECPP_EXE_PATH=.\${{ matrix.config }}\simplecpp.exe
7272
python -m pytest integration_test.py -vv || exit /b !errorlevel!
7373
74+
- name: run-tests.py
75+
run: |
76+
set SIMPLECPP_EXE_PATH=.\${{ matrix.config }}\simplecpp.exe
77+
python run-tests.py || exit /b !errorlevel!
78+
7479
- name: Run CMake (c++17)
7580
run: |
7681
cmake -S . -B build.cxx17 -A x64 -Werror=dev --warn-uninitialized -DCMAKE_CXX_STANDARD=17 -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!

‎run-tests.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ def cleanup(out: str) -> str:
2323
if not GCC_EXE:
2424
sys.exit('Failed to run tests: gcc compiler not found')
2525

26-
SIMPLECPP_EXE = './simplecpp'
26+
SIMPLECPP_EXE = os.environ.get('SIMPLECPP_EXE_PATH', './simplecpp')
2727

2828

2929
commands = []
3030

3131
for f in sorted(glob.glob(os.path.expanduser('testsuite/clang-preprocessor-tests/*.c*'))):
32+
f = f.replace('\\', '/') # glob returns backslash separators on Windows
3233
for line in open(f, 'rt', encoding='utf-8'):
3334
if line.startswith('// RUN: %clang_cc1 '):
3435
cmd = ''
@@ -40,6 +41,7 @@ def cleanup(out: str) -> str:
4041
if not newcmd in commands:
4142
commands.append(cmd[1:] + ' ' + f)
4243
for f in sorted(glob.glob(os.path.expanduser('testsuite/gcc-preprocessor-tests/*.c*'))):
44+
f = f.replace('\\', '/') # glob returns backslash separators on Windows
4345
commands.append('-E ' + f)
4446

4547
# skipping tests..

0 commit comments

Comments
 (0)