mirror of
https://github.com/open-goal/jak-project
synced 2026-08-08 10:34:30 -04:00
add a separate cmake configuration for code coverage builds
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Executable
+9
@@ -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
|
||||
Reference in New Issue
Block a user