Skip to content

Commit

Permalink
added cli Python tests to Cygwin and MinGW CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Jun 27, 2024
1 parent d388f45 commit f166cd1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/CI-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
arch: [x64]
include:
- platform: 'x86_64'
# python3 is necessary so we can execute addons
packages: |
gcc-g++
python3
Expand All @@ -42,6 +43,19 @@ jobs:
platform: ${{ matrix.arch }}
packages: ${{ matrix.packages }}

- name: Set up Python 3.12.3
uses: actions/setup-python@v5
with:
python-version: '3.12.3'
check-latest: true

- name: Install missing Python packages
run: |
python -m pip install pip --upgrade || exit /b !errorlevel!
python -m pip install pytest || exit /b !errorlevel!
python -m pip install pytest-custom_exit_code || exit /b !errorlevel!
python -m pip install pytest-timeout || exit /b !errorlevel!
# Cygwin will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries.
- name: Build all and run test
run: |
Expand All @@ -54,5 +68,10 @@ jobs:
python3 ..\misra.py -verify misra\misra-test.c.dump
..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c
- name: Run test/cli
run: |
cd test/cli
python3 -m pytest -Werror --strict-markers -vv
# TODO: add python tests

18 changes: 18 additions & 0 deletions .github/workflows/CI-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ jobs:
install: >-
mingw-w64-x86_64-lld
mingw-w64-x86_64-ccache
python3-pip
- name: Install missing Python packages
run: |
python -m pip install pytest
python -m pip install pytest-timeout
- name: ccache
uses: hendrikmuhs/[email protected]
Expand Down Expand Up @@ -70,4 +76,16 @@ jobs:
env:
LDFLAGS: -fuse-ld=lld # use lld for faster linking

- name: Extra test for misra
run: |
cd addons/test
../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64
python3 ../misra.py -verify misra/misra-test.c.dump
../../cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra/misra-ctu-1-test.c misra/misra-ctu-2-test.c
- name: Run test/cli
run: |
cd test/cli
python3 -m pytest -Werror --strict-markers -vv
# TODO: add python tests

0 comments on commit f166cd1

Please sign in to comment.