diff options
author | Christopher Haster <chaster@utexas.edu> | 2020-12-31 22:41:35 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2021-01-10 11:12:45 +0300 |
commit | eeeceb9e308491493e41520277319e4c3a44c3ee (patch) | |
tree | 57e4084881934a6de91362a11a399aedb7322c89 /.github/workflows/test.yml | |
parent | b2235e956dda7e69fc9048c1768fcfce45c913b9 (diff) |
Added coverage.py, and optional coverage info to test.py
Now coverage information can be collected if you provide the --coverage
to test.py. Internally this uses GCC's gcov instrumentation along with a
new script, coverage.py, to parse *.gcov files.
The main use for this is finding coverage info during CI runs. There's a
risk that the instrumentation may make it more difficult to debug, so I
decided to not make coverage collection enabled by default.
Diffstat (limited to '.github/workflows/test.yml')
-rw-r--r-- | .github/workflows/test.yml | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f36493..231cd2c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,7 @@ on: [push, pull_request] env: CFLAGS: -Werror MAKEFLAGS: -j + COVERAGE: 1 jobs: # run tests @@ -70,9 +71,10 @@ jobs: -Duser_provided_block_device_erase=NULL \ -Duser_provided_block_device_sync=NULL \ -include stdio.h" -# # normal+reentrant tests -# - name: test-default -# run: make test SCRIPTFLAGS+="-nrk" + # normal+reentrant tests + - name: test-default + continue-on-error: true + run: make test SCRIPTFLAGS+="-nrk" # # NOR flash: read/prog = 1 block = 4KiB # - name: test-nor # run: make test SCRIPTFLAGS+="-nrk @@ -102,6 +104,29 @@ jobs: # run: make test SCRIPTFLAGS+="-nrk # -DLFS_READ_SIZE=11 -DLFS_BLOCK_SIZE=704" + - name: test-default-what + run: | + echo "version" + gcov --version + echo "tests" + ls tests + echo "hmm" + cat tests/*.gcov + echo "woah" + + # collect coverage + - name: collect-coverage + continue-on-error: true + run: | + mkdir -p coverage + mv results/coverage.gcov coverage/${{github.job}}.gcov + - name: upload-coverage + continue-on-error: true + uses: actions/upload-artifact@v2 + with: + name: coverage + path: coverage + # update results - uses: actions/checkout@v2 if: github.ref != 'refs/heads/master' |