🔧 explicitly switch on tests in CI
This commit is contained in:
parent
ed5c28d00c
commit
325e8ab8ab
@ -10,12 +10,9 @@ jobs:
|
||||
- run:
|
||||
name: Install required tools
|
||||
command: 'apt-get update && apt-get install -y gcc g++ git cmake'
|
||||
- run:
|
||||
name: Show versions
|
||||
command: 'g++ --version ; uname -a; cmake --version'
|
||||
- run:
|
||||
name: Run CMake
|
||||
command: 'mkdir build ; cd build ; cmake ..'
|
||||
command: 'mkdir build ; cd build ; cmake .. -DJSON_BuildTests=On'
|
||||
- run:
|
||||
name: Compile
|
||||
command: 'cmake --build build'
|
||||
@ -33,12 +30,9 @@ jobs:
|
||||
- run:
|
||||
name: Install required tools
|
||||
command: 'pacman -Sy --noconfirm base base-devel gcc git cmake'
|
||||
- run:
|
||||
name: Show versions
|
||||
command: 'g++ --version ; uname -a; cmake --version'
|
||||
- run:
|
||||
name: Run CMake
|
||||
command: 'mkdir build ; cd build ; cmake ..'
|
||||
command: 'mkdir build ; cd build ; cmake .. -DJSON_BuildTests=On'
|
||||
- run:
|
||||
name: Compile
|
||||
command: 'cmake --build build'
|
||||
|
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: cmake
|
||||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug
|
||||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
|
||||
- name: build
|
||||
run: cmake --build build --parallel 10
|
||||
- name: test
|
||||
|
2
.github/workflows/ubuntu.yml
vendored
2
.github/workflows/ubuntu.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: cmake
|
||||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug
|
||||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
|
||||
- name: build
|
||||
run: cmake --build build --parallel 10
|
||||
- name: test
|
||||
|
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: cmake
|
||||
run: cmake -S . -B build -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Debug
|
||||
run: cmake -S . -B build -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
|
||||
- name: build
|
||||
run: cmake --build build --parallel 10
|
||||
- name: test
|
||||
|
@ -321,13 +321,9 @@ script:
|
||||
# by default, use the single-header version
|
||||
- if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
|
||||
|
||||
# show OS/compiler version
|
||||
- uname -a
|
||||
- $CXX --version
|
||||
|
||||
# compile and execute unit tests
|
||||
- mkdir -p build && cd build
|
||||
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -GNinja && cmake --build . --config Release
|
||||
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -GNinja && cmake --build . --config Release -DJSON_BuildTests=On
|
||||
- ctest -C Release --timeout 2700 -V -j
|
||||
- cd ..
|
||||
|
||||
|
@ -1501,7 +1501,7 @@ To compile and run the tests, you need to execute
|
||||
```sh
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake ..
|
||||
$ cmake .. -DJSON_BuildTests=On
|
||||
$ cmake --build .
|
||||
$ ctest --output-on-failure
|
||||
```
|
||||
|
@ -112,7 +112,7 @@ before_build:
|
||||
# for with_win_header build, inject the inclusion of Windows.h to the single-header library
|
||||
- ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
|
||||
- ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
|
||||
- if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin") else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin")
|
||||
- if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On) else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On)
|
||||
|
||||
build_script:
|
||||
- cmake --build . --config "%configuration%"
|
||||
|
@ -183,6 +183,7 @@ add_dependencies(json_unit download_test_data)
|
||||
#############################################################################
|
||||
# Test the generated build configs
|
||||
#############################################################################
|
||||
|
||||
add_subdirectory(cmake_import)
|
||||
add_subdirectory(cmake_import_minver)
|
||||
add_subdirectory(cmake_add_subdirectory)
|
||||
|
Loading…
Reference in New Issue
Block a user