Skip to content

Commit

Permalink
CI: Run test also on Windows runners.
Browse files Browse the repository at this point in the history
  • Loading branch information
mity committed Feb 4, 2024
1 parent 94ad82a commit e7c4392
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 77 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Build
run: make VERBOSE=1
- name: Test
run: ./scripts/run-tests.sh
run: python3 ./scripts/run-tests.py
- name: Create coverage report
run: |
sudo apt-get install -y lcov
Expand All @@ -29,6 +29,7 @@ jobs:
lcov --list coverage.info
- name: Upload coverage report
uses: codecov/codecov-action@v3

linux-release:
runs-on: ubuntu-latest
steps:
Expand All @@ -39,7 +40,7 @@ jobs:
- name: Build
run: make VERBOSE=1
- name: Test
run: ./scripts/run-tests.sh
run: python3 ./scripts/run-tests.py

# Windows builds.
#
Expand All @@ -58,6 +59,10 @@ jobs:
run: cmake -DCMAKE_BUILD_TYPE=Debug -G "NMake Makefiles" .
- name: Build
run: nmake
- name: Setyp Python
uses: actions/setup-python@v5
- name: Test
run: python .\scripts\run-tests.py

windows-64-release:
runs-on: windows-latest
Expand All @@ -72,3 +77,5 @@ jobs:
run: cmake -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" .
- name: Build
run: nmake
- name: Test
run: python .\scripts\run-tests.py
46 changes: 46 additions & 0 deletions scripts/run-tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env python3

import glob
import os
import subprocess
import sys


argv0_dir = os.path.dirname(sys.argv[0])
project_dir = os.path.abspath(os.path.join(argv0_dir, ".."))
test_dir = os.path.join(project_dir, "test")
program = os.path.abspath(os.path.join("md2html", "md2html"))

if __name__ == "__main__":
err_count = 0

os.chdir(test_dir)

for testsuite in glob.glob('*.txt'):
print("Testing {}".format(testsuite))
sys.stdout.flush()
sys.stderr.flush()
args = [
sys.executable,
"run-testsuite.py",
"-s", testsuite,
"-p", str(program)
]
p = subprocess.run(args)
if p.returncode != 0:
err_count += 1
print()

print("Testing pathological inputs:")
sys.stdout.flush()
sys.stderr.flush()
args = [
sys.executable,
"pathological-tests.py",
"-p", str(program)
]
subprocess.run(args)
if p.returncode != 0:
err_count += 1

sys.exit(err_count)
75 changes: 0 additions & 75 deletions scripts/run-tests.sh

This file was deleted.

0 comments on commit e7c4392

Please sign in to comment.