Add travis, coverall and other things.
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -10,3 +10,6 @@
|
||||
[submodule "external/lodepng"]
|
||||
path = external/lodepng
|
||||
url = https://github.com/lvandeve/lodepng
|
||||
[submodule "external/coveralls-cmake"]
|
||||
path = external/coveralls-cmake
|
||||
url = https://github.com/JoakimSoderberg/coveralls-cmake.git
|
||||
|
||||
26
.travis.yml
Normal file
26
.travis.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
dist: bionic
|
||||
language: c
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
|
||||
script:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
make test
|
||||
cd ..
|
||||
mkdir coverage
|
||||
cd coverage
|
||||
cmake .. -DCOVERALL=ON -DCMAKE_BUILD_TYPE=Debug
|
||||
cmake --build .
|
||||
cmake --build . --target coveralls
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
@@ -6,19 +6,37 @@ project(DoRayMe)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
option(COVERALLS "Generate coveralls data" OFF)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/external/coveralls-cmake/cmake)
|
||||
|
||||
# LodePNG don't make a .a or .so, so let's build a library here
|
||||
add_library(LodePNG STATIC)
|
||||
set(LODEPNG_INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/external/lodepng)
|
||||
target_sources(LodePNG PRIVATE external/lodepng/lodepng.cpp external/lodepng/lodepng.h)
|
||||
|
||||
|
||||
if (COVERALLS)
|
||||
include(Coveralls)
|
||||
coveralls_turn_on_coverage()
|
||||
endif()
|
||||
|
||||
# Main app
|
||||
add_subdirectory(source)
|
||||
|
||||
|
||||
option(PACKAGE_TESTS "Build the tests" ON)
|
||||
if(PACKAGE_TESTS)
|
||||
if(PACKAGE_TESTS OR COVERALLS)
|
||||
enable_testing()
|
||||
include(GoogleTest)
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/external/googletest" "external/googletest")
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/external/googletest" "external/googletest")
|
||||
add_subdirectory(tests)
|
||||
|
||||
|
||||
if (COVERALLS)
|
||||
# Create the coveralls target.
|
||||
coveralls_setup(
|
||||
"${COVERAGE_SRCS}" # The source files.
|
||||
ON # If we should upload.
|
||||
) # (Optional) Alternate project cmake module path.
|
||||
endif ()
|
||||
endif()
|
||||
1
external/coveralls-cmake
vendored
Submodule
1
external/coveralls-cmake
vendored
Submodule
Submodule external/coveralls-cmake added at 9f96714bdf
@@ -18,4 +18,8 @@ target_link_libraries(rayonnement LodePNG)
|
||||
# Second we build the main executable
|
||||
add_executable(dorayme main.cpp)
|
||||
target_include_directories(rayonnement PUBLIC include ${LODEPNG_INCLUDE_FOLDER})
|
||||
target_link_libraries(dorayme rayonnement)
|
||||
target_link_libraries(dorayme rayonnement)
|
||||
|
||||
if (COVERALLS)
|
||||
set(COVERAGE_SRCS ${RAY_HEADERS} ${RAY_SOURCES} ${COVERAGE_SRCS} PARENT_SCOPE)
|
||||
endif()
|
||||
Reference in New Issue
Block a user