Skip to content

github workflow: additional coverage #20

github workflow: additional coverage

github workflow: additional coverage #20

name: Non-regression testing
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
non-regression-for-python:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"] # , "ubuntu-lastest", "macos-latest"]
python-version: ["3.10", "pypy2.7", "pypy3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install pytest pyparsing coverage codecov
pwd
ls -l
git clone https://github.com/LRGH/elfesteem
git clone https://github.com/LRGH/miasmX
git clone https://github.com/LRGH/crysp
git clone https://github.com/LRGH/amoco
echo > amoco/amoco/__init__.py # don't import grandalf
cat plasmasm/python/amoco-config.py > amoco/amoco/config.py # avoid dependency on traitlets
ls -l
mv elfesteem miasmX crysp amoco ..
ls -l ..
export PYTHONPATH=../elfesteem:../miasmx:../amoco:../crysp
python -c 'import sys; print(sys.path)'
echo '** Import miasmX'
python -c 'import miasmX'
echo '** Import amoco'
python -c 'import amoco'
echo '** Simple tests to verify that dependencies are working'
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.intel.s || true
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.att.s || true
python tools/disass.py -a -c /MIASM non_regression/basic_x86_linux.att.s | tr '\t' _
python tools/disass.py -a -c /MIASM non_regression/basic_x86_linux.att.s > /tmp/a.s
diff -c non_regression/basic_x86_linux.att.s.asm /tmp/a.s
python tools/disass.py -a -c /AMOCO non_regression/basic_x86_linux.att.s | tr '\t' _
python tools/disass.py -a -c /AMOCO non_regression/basic_x86_linux.att.s > /tmp/a.s
diff -c non_regression/basic_x86_linux.att.s.asm /tmp/a.s
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.o || true
python tools/disass.py -c /AMOCO non_regression/basic_x86_linux.att.s || true
python tools/disass.py -c /AMOCO non_regression/basic_x86_linux.o || true
- name: Unit tests without using pytest module
run: |
python non_regression/run_tests.py test_asm_basic
- name: Unit tests
run: |
coverage run -m pytest --durations=10 non_regression/test_asm_basic.py
coverage run -m pytest --durations=10 non_regression/test_asm_other.py
coverage run -m pytest --durations=10 non_regression/test_asm_switch.py
coverage run -m pytest --durations=10 non_regression/test_bin.py
coverage run -m pytest --durations=10 non_regression/test_display.py
coverage run -m pytest --durations=10 non_regression/test_objdump.py
- name: Global tests
run: |
coverage run -m pytest --durations=10 non_regression/test_asm_fullsoftware.py
- name: Update codecov
run: |
codecov
matrix-with-compilers:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
gcc-version: ["7"] # , "8", "9", "10", "11"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up GCC ${{ matrix.gcc-version }}
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.gcc-version }}
platform: x64
- name: Install dependencies
run: |
python -m pip install pytest pyparsing coverage codecov
cd ..
git clone https://github.com/LRGH/elfesteem
git clone https://github.com/LRGH/miasmX
git clone https://github.com/LRGH/crysp
git clone https://github.com/LRGH/amoco
echo > amoco/amoco/__init__.py # don't import grandalf
cat plasmasm/plasmasm/python/amoco-config.py > amoco/amoco/config.py # avoid dependency on traitlets
cd plasmasm
export PYTHONPATH=../elfesteem:../miasmx:../amoco:../crysp
echo '** Simple tests to verify that dependencies are working'
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.intel.s || true
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.att.s || true
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.o || true
python tools/disass.py -c /AMOCO non_regression/basic_x86_linux.att.s || true
python tools/disass.py -c /AMOCO non_regression/basic_x86_linux.o || true
- name: Testing compile.py with a minimal program
run: |
export PATH=$(pwd)/tools:$PATH
echo 'int main() { return 10; }' > a.c
compile.py -parse_asm gcc a.c
compile.py -parse_asm -rw -dead gcc a.c
compile.py -parse_obj gcc a.c
compile.py -change gcc a.c
- name: Testing compile.py with zlib
run: |
export PATH=$(pwd)/tools:$PATH
curl -O https://zlib.net/fossils/zlib-1.2.8.tar.gz
tar xzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make clean; make test CC='compile.py -parse_asm gcc'
make clean; make test CC='compile.py -parse_asm -rw -dead gcc'
make clean; make test CC='compile.py -parse_obj gcc'
make clean; make test CC='compile.py -change gcc'