mirror of
https://github.com/verilator/verilator.git
synced 2025-04-11 23:46:55 +00:00
CI: Fix coverage action
This commit is contained in:
parent
e972668169
commit
6060acc73d
3
.github/workflows/coverage.yml
vendored
3
.github/workflows/coverage.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
./ci/ci-script.bash
|
./ci/ci-script.bash
|
||||||
|
|
||||||
tar cvzf verilator-${CI_COMMIT}-coverage.tgz bin src/obj*/*.gcno
|
tar cvzf verilator-${CI_COMMIT}-coverage.tgz bin src/obj*/*.o src/obj*/*.gcno
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
@ -87,6 +87,7 @@ jobs:
|
|||||||
- name: Install Verilator and test dependencies
|
- name: Install Verilator and test dependencies
|
||||||
run: |
|
run: |
|
||||||
tar xvzf artifact/verilator-${CI_COMMIT}-coverage.tgz
|
tar xvzf artifact/verilator-${CI_COMMIT}-coverage.tgz
|
||||||
|
touch src/obj*/*.o src/obj*/*.gcno
|
||||||
./ci/ci-install.bash
|
./ci/ci-install.bash
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
|
@ -51,7 +51,7 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
|
|||||||
stat bin/verilator_bin_dbg
|
stat bin/verilator_bin_dbg
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
nodist/code_coverage --stages 1-2
|
nodist/code_coverage --stages 0-2
|
||||||
fi
|
fi
|
||||||
elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -97,34 +97,34 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
|||||||
"$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2
|
"$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2
|
||||||
;;
|
;;
|
||||||
coverage-all)
|
coverage-all)
|
||||||
nodist/code_coverage --stages 3-
|
nodist/code_coverage --stages 1-
|
||||||
;;
|
;;
|
||||||
coverage-dist)
|
coverage-dist)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--dist
|
nodist/code_coverage --stages 1- --scenarios=--dist
|
||||||
;;
|
;;
|
||||||
coverage-vlt-0)
|
coverage-vlt-0)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--vlt --hashset=0/4
|
nodist/code_coverage --stages 1- --scenarios=--vlt --hashset=0/4
|
||||||
;;
|
;;
|
||||||
coverage-vlt-1)
|
coverage-vlt-1)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--vlt --hashset=1/4
|
nodist/code_coverage --stages 1- --scenarios=--vlt --hashset=1/4
|
||||||
;;
|
;;
|
||||||
coverage-vlt-2)
|
coverage-vlt-2)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--vlt --hashset=2/4
|
nodist/code_coverage --stages 1- --scenarios=--vlt --hashset=2/4
|
||||||
;;
|
;;
|
||||||
coverage-vlt-3)
|
coverage-vlt-3)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--vlt --hashset=3/4
|
nodist/code_coverage --stages 1- --scenarios=--vlt --hashset=3/4
|
||||||
;;
|
;;
|
||||||
coverage-vltmt-0)
|
coverage-vltmt-0)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--vltmt --hashset=0/4
|
nodist/code_coverage --stages 1- --scenarios=--vltmt --hashset=0/4
|
||||||
;;
|
;;
|
||||||
coverage-vltmt-1)
|
coverage-vltmt-1)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--vltmt --hashset=1/4
|
nodist/code_coverage --stages 1- --scenarios=--vltmt --hashset=1/4
|
||||||
;;
|
;;
|
||||||
coverage-vltmt-2)
|
coverage-vltmt-2)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--vltmt --hashset=2/4
|
nodist/code_coverage --stages 1- --scenarios=--vltmt --hashset=2/4
|
||||||
;;
|
;;
|
||||||
coverage-vltmt-3)
|
coverage-vltmt-3)
|
||||||
nodist/code_coverage --stages 3- --scenarios=--vltmt --hashset=3/4
|
nodist/code_coverage --stages 1- --scenarios=--vltmt --hashset=3/4
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
fatal "Unknown test: $TESTS"
|
fatal "Unknown test: $TESTS"
|
||||||
|
@ -26,10 +26,15 @@ def test():
|
|||||||
sys.exit("%Error: Run code_coverage from the top of the verilator kit")
|
sys.exit("%Error: Run code_coverage from the top of the verilator kit")
|
||||||
exec(open("./nodist/code_coverage.dat").read())
|
exec(open("./nodist/code_coverage.dat").read())
|
||||||
|
|
||||||
|
if Args.stage_enabled[0]:
|
||||||
|
ci_fold_start("distclean")
|
||||||
|
print("Stage 0: distclean")
|
||||||
|
run("make distclean || true")
|
||||||
|
ci_fold_end()
|
||||||
|
|
||||||
if Args.stage_enabled[1]:
|
if Args.stage_enabled[1]:
|
||||||
ci_fold_start("configure")
|
ci_fold_start("configure")
|
||||||
print("Stage 1: configure (coverage on)")
|
print("Stage 1: configure (coverage on)")
|
||||||
run("make distclean || true")
|
|
||||||
run("autoconf")
|
run("autoconf")
|
||||||
# Exceptions can pollute the branch coverage data
|
# Exceptions can pollute the branch coverage data
|
||||||
run("./configure --enable-longtests CXX='g++ --coverage -fno-exceptions -DVL_GCOV'"
|
run("./configure --enable-longtests CXX='g++ --coverage -fno-exceptions -DVL_GCOV'"
|
||||||
@ -387,7 +392,7 @@ if True:
|
|||||||
start = int(match_from.group(1))
|
start = int(match_from.group(1))
|
||||||
else:
|
else:
|
||||||
os.exit("%Error: --stages not understood: " + Args.stages)
|
os.exit("%Error: --stages not understood: " + Args.stages)
|
||||||
for n in range(1, 100):
|
for n in range(0, 100):
|
||||||
Args.stage_enabled[n] = False
|
Args.stage_enabled[n] = False
|
||||||
for n in range(start, end + 1):
|
for n in range(start, end + 1):
|
||||||
Args.stage_enabled[n] = True
|
Args.stage_enabled[n] = True
|
||||||
|
Loading…
Reference in New Issue
Block a user