mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
32 lines
732 B
Bash
Executable File
32 lines
732 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# Build RGBDS with gcov support
|
|
make coverage -j
|
|
|
|
# Run the tests
|
|
pushd test
|
|
./fetch-test-deps.sh
|
|
./run-tests.sh
|
|
popd
|
|
|
|
# Generate coverage logs
|
|
gcov src/**/*.cpp
|
|
mkdir -p coverage
|
|
|
|
# Generate coverage report, excluding Bison-generated files
|
|
COVERAGE_INFO=coverage/coverage.info
|
|
lcov -c --no-external -d . -o "$COVERAGE_INFO"
|
|
lcov -r "$COVERAGE_INFO" src/asm/parser.{hpp,cpp} src/link/script.{hpp,cpp} -o "$COVERAGE_INFO"
|
|
genhtml --dark-mode -f -s -o coverage/ "$COVERAGE_INFO"
|
|
|
|
# Check whether running from coverage.yml workflow
|
|
if [ "$1" != "false" ]; then
|
|
# Open report in web browser
|
|
if [ "$(uname)" == "Darwin" ]; then
|
|
open coverage/index.html
|
|
else
|
|
xdg-open coverage/index.html
|
|
fi
|
|
fi
|