forked from cosmoscout/cosmoscout-vr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c538aa6
commit 32f1d7e
Showing
29 changed files
with
485 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# ------------------------------------------------------------------------------------------------ # | ||
# This file is part of CosmoScout VR # | ||
# and may be used under the terms of the MIT license. See the LICENSE file for details. # | ||
# Copyright: (c) 2019 German Aerospace Center (DLR) # | ||
# ------------------------------------------------------------------------------------------------ # | ||
|
||
# Locate header. | ||
find_path(DOCTEST_INCLUDE_DIR doctest/doctest.h | ||
HINTS ${DOCTEST_ROOT_DIR}/include) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(DOCTEST DEFAULT_MSG DOCTEST_INCLUDE_DIR) | ||
|
||
# Add imported target. | ||
if(DOCTEST_FOUND) | ||
set(DOCTEST_INCLUDE_DIRS "${DOCTEST_INCLUDE_DIR}") | ||
|
||
if(NOT DOCTEST_FIND_QUIETLY) | ||
message(STATUS "DOCTEST_INCLUDE_DIRS .......... ${DOCTEST_INCLUDE_DIR}") | ||
endif() | ||
|
||
if(NOT TARGET doctest::doctest) | ||
add_library(doctest::doctest INTERFACE IMPORTED) | ||
set_target_properties(doctest::doctest PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${DOCTEST_INCLUDE_DIRS}") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@echo off | ||
|
||
rem ---------------------------------------------------------------------------------------------- # | ||
rem This file is part of CosmoScout VR # | ||
rem and may be used under the terms of the MIT license. See the LICENSE file for details. # | ||
rem Copyright: (c) 2019 German Aerospace Center (DLR) # | ||
rem ---------------------------------------------------------------------------------------------- # | ||
|
||
rem Change working directory to the location of this script. | ||
set SCRIPT_DIR=%~dp0 | ||
set CURRENT_DIR=%cd% | ||
cd "%SCRIPT_DIR%" | ||
|
||
rem Set paths so that all libraries are found. | ||
set PATH=%SCRIPT_DIR%\..\lib;%PATH% | ||
|
||
cosmoscout.exe --run-tests | ||
|
||
rem Go back to where we came from | ||
cd "%CURRENT_DIR%" | ||
|
||
@echo on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# ------------------------------------------------------------------------------------------------ # | ||
# This file is part of CosmoScout VR # | ||
# and may be used under the terms of the MIT license. See the LICENSE file for details. # | ||
# Copyright: (c) 2019 German Aerospace Center (DLR) # | ||
# ------------------------------------------------------------------------------------------------ # | ||
|
||
# Change working directory to the location of this script. | ||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" | ||
cd "$SCRIPT_DIR" | ||
|
||
# Set paths so that all libraries are found. | ||
export LD_LIBRARY_PATH=../lib:../lib/DriverPlugins:$LD_LIBRARY_PATH | ||
|
||
./cosmoscout --run-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
|
||
# ------------------------------------------------------------------------------------------------ # | ||
# This file is part of CosmoScout VR # | ||
# and may be used under the terms of the MIT license. See the LICENSE file for details. # | ||
# Copyright: (c) 2019 German Aerospace Center (DLR) # | ||
# ------------------------------------------------------------------------------------------------ # | ||
|
||
# Exit on error. | ||
set -e | ||
|
||
# ------------------------------------------------------------------------------------------------ # | ||
# This script uses lcov to capture the source coverage of the test executed with run_all_tests.sh. # | ||
# The environment variable COSMOSCOUT_DEBUG_BUILD is checked in order to use the data in # | ||
# build/linux-$BUILD_TYPE and install/linux-$BUILD_TYPE. # | ||
# If you pass any argument to the script (say ./lcov.sh foo) then it will create also an html # | ||
# report and open this report in your web browser. # | ||
# ------------------------------------------------------------------------------------------------ # | ||
|
||
# create some required variables ------------------------------------------------------------------- | ||
|
||
# Get the location of this script. | ||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" | ||
cd $SCRIPT_DIR | ||
|
||
# Check if ComoScout VR debug build is enabled with "export COSMOSCOUT_DEBUG_BUILD=true". | ||
BUILD_TYPE=release | ||
case "$COSMOSCOUT_DEBUG_BUILD" in | ||
(true) echo "CosmoScout VR debug build is enabled!"; BUILD_TYPE=debug; | ||
esac | ||
|
||
# Get the current directory - this should contain the build and install directory. | ||
CURRENT_DIR="$(pwd)" | ||
|
||
# The build directory. | ||
BUILD_DIR="$CURRENT_DIR/build/linux-$BUILD_TYPE" | ||
|
||
# The install directory. | ||
INSTALL_DIR="$CURRENT_DIR/install/linux-$BUILD_TYPE" | ||
|
||
# create zero-coverage info ------------------------------------------------------------------------ | ||
|
||
lcov -q --zerocounters --directory . | ||
lcov -q --capture --no-external --initial --directory . --output-file $BUILD_DIR/zero_coverage.info | ||
|
||
# run the tests ------------------------------------------------------------------------------------ | ||
|
||
$INSTALL_DIR/bin/run_all_tests.sh | ||
|
||
# capture the coverage of the test ----------------------------------------------------------------- | ||
|
||
lcov -q --capture --no-external --directory . --output-file $BUILD_DIR/test_coverage.info | ||
lcov -q -a $BUILD_DIR/zero_coverage.info -a $BUILD_DIR/test_coverage.info --o $BUILD_DIR/coverage.info | ||
|
||
# Remove any coverage from externals, examples and test directories. | ||
lcov -q --remove $BUILD_DIR/coverage.info \*externals\* --output-file $BUILD_DIR/coverage.info | ||
lcov -q --remove $BUILD_DIR/coverage.info \*test\* --output-file $BUILD_DIR/coverage.info | ||
|
||
# Generate html report and open it in a web browser when an argument was passed to the script. | ||
if [ $# != 0 ] | ||
then | ||
genhtml $BUILD_DIR/coverage.info --output-directory $BUILD_DIR/coverage | ||
xdg-open $BUILD_DIR/coverage/index.html | ||
fi |
Oops, something went wrong.