Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
268f5a3d
Unverified
Commit
268f5a3d
authored
Aug 25, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
👷
added option to switch off exceptions
parent
839681ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
.travis.yml
.travis.yml
+2
-6
test/CMakeLists.txt
test/CMakeLists.txt
+12
-3
No files found.
.travis.yml
View file @
268f5a3d
...
...
@@ -64,19 +64,15 @@ matrix:
-
make cppcheck
# no exceptions
-
os
:
linux
compiler
:
gcc
env
:
-
COMPILER=g++-4.9
-
SPECIAL=no_exceptions
-
CMAKE_OPTIONS=-DJSON_NoExceptions=ON
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
]
packages
:
[
'
g++-4.9'
,
'
cppcheck'
,
'
ninja-build'
]
after_success
:
-
make clean
-
CPPFLAGS="-DJSON_NOEXCEPTION" make check TEST_PATTERN="-e \"*\""
packages
:
[
'
g++-4.9'
,
'
ninja-build'
]
# Coveralls (http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/)
...
...
test/CMakeLists.txt
View file @
268f5a3d
option
(
JSON_Sanitizer
"Build test suite with Clang sanitizer"
OFF
)
option
(
JSON_Valgrind
"Execute test suite with Valgrind"
OFF
)
option
(
JSON_NoExceptions
"Build test suite without exceptions"
OFF
)
if
(
JSON_Sanitizer
)
message
(
STATUS
"Building test suite with Clang sanitizer"
)
...
...
@@ -16,6 +17,14 @@ if(JSON_Valgrind)
separate_arguments
(
memcheck_command
)
endif
()
if
(
JSON_NoExceptions
)
message
(
STATUS
"Building test suite without exceptions"
)
if
(
NOT MSVC
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DJSON_NOEXCEPTION"
)
endif
()
set
(
CATCH_TEST_FILTER -e
)
endif
()
#############################################################################
# Catch library with the main function to speed up build
#############################################################################
...
...
@@ -62,20 +71,20 @@ foreach(file ${files})
endif
()
add_test
(
NAME
"
${
testcase
}
_default"
COMMAND
${
testcase
}
COMMAND
${
testcase
}
${
CATCH_TEST_FILTER
}
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
set_tests_properties
(
"
${
testcase
}
_default"
PROPERTIES LABELS
"default"
)
add_test
(
NAME
"
${
testcase
}
_all"
COMMAND
${
testcase
}
"*"
COMMAND
${
testcase
}
${
CATCH_TEST_FILTER
}
"*"
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
set_tests_properties
(
"
${
testcase
}
_all"
PROPERTIES LABELS
"all"
)
if
(
JSON_Valgrind
)
add_test
(
NAME
"
${
testcase
}
_valgrind"
COMMAND
${
memcheck_command
}
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
testcase
}
COMMAND
${
memcheck_command
}
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
testcase
}
${
CATCH_TEST_FILTER
}
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
set_tests_properties
(
"
${
testcase
}
_valgrind"
PROPERTIES LABELS
"valgrind"
)
...
...
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