split unit tests
This commit is contained in:
parent
263e6af48d
commit
5541e6f6f9
8 changed files with 66 additions and 11 deletions
|
@ -3,6 +3,7 @@ set(JSON_UNITTEST_TARGET_NAME "json_unit")
|
|||
add_executable(${JSON_UNITTEST_TARGET_NAME}
|
||||
"src/catch.hpp"
|
||||
"src/unit.cpp"
|
||||
"src/unit-runner.cpp"
|
||||
)
|
||||
|
||||
set_target_properties(${JSON_UNITTEST_TARGET_NAME} PROPERTIES
|
||||
|
|
21
test/Makefile
Normal file
21
test/Makefile
Normal file
|
@ -0,0 +1,21 @@
|
|||
##########################################################################
|
||||
# unit tests
|
||||
##########################################################################
|
||||
|
||||
# additional flags
|
||||
CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Weffc++ -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor -Wreorder -Wdeprecated -Wfloat-equal
|
||||
INCDIRS = -I ../src -I .
|
||||
|
||||
SOURCES = src/unit-runner.cpp src/unit.cpp
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
|
||||
all: json_unit
|
||||
|
||||
json_unit: $(OBJECTS) ../src/json.hpp src/catch.hpp
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) $(INCDIRS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -fr json_unit $(OBJECTS)
|
30
test/src/unit-runner.cpp
Normal file
30
test/src/unit-runner.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
__ _____ _____ _____
|
||||
__| | __| | | | JSON for Modern C++ (test suite)
|
||||
| | |__ | | | | | | version 2.0.2
|
||||
|_____|_____|_____|_|___| https://github.com/nlohmann/json
|
||||
|
||||
Licensed under the MIT License <http://opensource.org/licenses/MIT>.
|
||||
Copyright (c) 2013-2016 Niels Lohmann <http://nlohmann.me>.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
|
@ -26,12 +26,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <deque>
|
||||
#include <forward_list>
|
||||
#include <fstream>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue