add a separate cmake configuration for code coverage builds

This commit is contained in:
water
2020-09-08 19:15:38 -04:00
parent 699270c00c
commit c9e99b8ebe
5 changed files with 19 additions and 7 deletions
+3 -3
View File
@@ -34,14 +34,14 @@ jobs:
- name: CMake Generation
run: |
cmake --version
cmake -B build
cmake -B build -DCODE_COVERAGE=ON
- name: Build Project
run: |
cd build
make -j2
make -j
- name: Run Tests
timeout-minutes: 5
run: ./test.sh
run: ./test_code_coverage.sh
- name: Coveralls
uses: coverallsapp/github-action@master
with:
+5 -1
View File
@@ -33,11 +33,15 @@ IF (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
ENDIF()
option(CODE_COVERAGE "Enable Code Coverage Compiler Flags" OFF)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/)
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX AND CODE_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
message("Code Coverage build is enabled!")
else()
message("Code Coverage build is disabled!")
endif()
# includes relative to top level jak-project folder
+1 -2
View File
@@ -5,5 +5,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export NEXT_DIR=$DIR
export FAKE_ISO_PATH=/game/fake_iso.txt
cd $DIR/build/
make goalc-test_coverage
$DIR/build/test/goalc-test --gtest_color=yes "$@"
+1 -1
View File
@@ -25,7 +25,7 @@ ELSE()
target_link_libraries(goalc-test goos util listener runtime compiler type_system gtest)
ENDIF()
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX AND CODE_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
setup_target_for_coverage_lcov(NAME goalc-test_coverage
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
# Directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export NEXT_DIR=$DIR
export FAKE_ISO_PATH=/game/fake_iso.txt
cd $DIR/build/
make goalc-test_coverage