Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
25d60b7b
Commit
25d60b7b
authored
May 18, 2016
by
Niels
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #247 from robertmrk/feature/cmake-cleanup
Define CMake/CTest tests
parents
83761712
639d6321
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
CMakeLists.txt
CMakeLists.txt
+2
-0
appveyor.yml
appveyor.yml
+1
-2
CMakeLists.txt
test/CMakeLists.txt
+13
-9
No files found.
CMakeLists.txt
View file @
25d60b7b
...
...
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0)
# define the project
project
(
nlohmann_json VERSION 2.0.0 LANGUAGES CXX
)
enable_testing
()
option
(
BuildTests
"Build the unit tests"
ON
)
# define project variables
...
...
appveyor.yml
View file @
25d60b7b
...
...
@@ -7,5 +7,4 @@ build_script:
-
cmake . -G "Visual Studio 14 2015"
-
cmake --build . --config Release
test_script
:
-
test\Release\json_unit.exe
-
test\Release\json_unit.exe "*"
-
ctest -C Release -V
test/CMakeLists.txt
View file @
25d60b7b
# The unit test executable.
add_executable
(
json_unit
set
(
JSON_UNITTEST_TARGET_NAME
"json_unit"
)
add_executable
(
${
JSON_UNITTEST_TARGET_NAME
}
"src/catch.hpp"
"src/unit.cpp"
)
set_target_properties
(
json_unit
PROPERTIES
set_target_properties
(
${
JSON_UNITTEST_TARGET_NAME
}
PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON
COMPILE_DEFINITIONS
"$<$<CXX_COMPILER_ID:MSVC>:_SCL_SECURE_NO_WARNINGS>"
COMPILE_OPTIONS
"$<$<CXX_COMPILER_ID:MSVC>:/EHsc;$<$<CONFIG:Release>:/Od>>"
)
# Install the test binary.
install
(
TARGETS json_unit RUNTIME DESTINATION test/bin
)
target_include_directories
(
${
JSON_UNITTEST_TARGET_NAME
}
PRIVATE
"src"
)
target_link_libraries
(
${
JSON_UNITTEST_TARGET_NAME
}
${
JSON_TARGET_NAME
}
)
# Copy the test data to the install tree.
install
(
DIRECTORY data/ DESTINATION test/data
)
target_include_directories
(
json_unit PRIVATE
"src"
)
target_link_libraries
(
json_unit
${
JSON_TARGET_NAME
}
)
add_test
(
NAME
"
${
JSON_UNITTEST_TARGET_NAME
}
_default"
COMMAND
${
JSON_UNITTEST_TARGET_NAME
}
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
add_test
(
NAME
"
${
JSON_UNITTEST_TARGET_NAME
}
_all"
COMMAND
${
JSON_UNITTEST_TARGET_NAME
}
"*"
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment