https://github.com/penn-graphics-research/ziran2019
Tip revision: 35742ac3ab1ae42cf2bbe8761fd7c8e630a638c4 authored by JoshWolper on 28 October 2020, 15:53:00 UTC
Add files via upload
Add files via upload
Tip revision: 35742ac
test_coverage.sh
#!/bin/bash
# Before running this script you must build with scons TYPE=coverage
set -e
# This script assumes that either it is run from the ziran base directory
# or that the ZIRAN variable is set to the location of the base directory
ZIRAN="${ZIRAN:-$(pwd -P)}"
# reset execution counts to zero
lcov --directory "$ZIRAN/Tests" --zerocounters
# capture baseline data (so that unrun functions report zero coverage)
# uninstantiated templates will not be included
lcov --initial --capture --directory "$ZIRAN/Tests" --output-file coverage.initial
# run the tests
./Tests/tests
# capture run counts
lcov --capture --directory "$ZIRAN/Tests" --output-file coverage.run
# combine initial and run
lcov --add-tracefile coverage.initial --add-tracefile coverage.run --output-file coverage.total
# remove run counts for non-ziran files
lcov --extract coverage.total "$ZIRAN/*" --output-file coverage.ziran
# generate html
genhtml coverage.ziran --output-directory coverage
rm coverage.initial coverage.run coverage.total coverage.ziran
