mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-08-31 14:11:14 +02:00
add install test
This commit is contained in:
parent
c2d7dff1a8
commit
b0384f889a
2 changed files with 39 additions and 4 deletions
30
.github/workflows/install.yml
vendored
Normal file
30
.github/workflows/install.yml
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
name: Install
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CTEST_OUTPUT_ON_FAILURE: 1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: install
|
||||||
|
run: |
|
||||||
|
cmake -H. -Bbuild
|
||||||
|
cmake --build build --target install
|
||||||
|
|
||||||
|
- name: configure
|
||||||
|
run: cmake -Htest -Bbuild/test -DTEST_INSTALLED_VERSION=1
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build/test --config Debug
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
run: |
|
||||||
|
cd build/test
|
||||||
|
ctest --build-config Debug
|
|
@ -7,6 +7,7 @@ project(GreeterTests
|
||||||
# ---- Options ----
|
# ---- Options ----
|
||||||
|
|
||||||
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
|
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
|
||||||
|
option(TEST_INSTALLED_VERSION "Test the version found by find_package" OFF)
|
||||||
|
|
||||||
# ---- Dependencies ----
|
# ---- Dependencies ----
|
||||||
|
|
||||||
|
@ -19,10 +20,14 @@ CPMAddPackage(
|
||||||
GIT_TAG 2.3.2
|
GIT_TAG 2.3.2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (TEST_INSTALLED_VERSION)
|
||||||
|
find_package(Greeter)
|
||||||
|
else()
|
||||||
CPMAddPackage(
|
CPMAddPackage(
|
||||||
NAME Greeter
|
NAME Greeter
|
||||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
CPMAddPackage(
|
CPMAddPackage(
|
||||||
NAME Format.cmake
|
NAME Format.cmake
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue