Skip to content

Commit a50a140

Browse files
authored
Merge pull request #2081 from nlohmann/external_test_data
Use external test data
2 parents 634fa87 + 2304629 commit a50a140

File tree

1,104 files changed

+1274
-6297717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,104 files changed

+1274
-6297717
lines changed

.circleci/config.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,17 @@ jobs:
88
- checkout
99

1010
- run:
11-
name: Install sudo
12-
command: 'apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*'
11+
name: Install required tools
12+
command: 'apt-get update && apt-get install -y gcc g++ git cmake'
1313
- run:
14-
name: Install GCC
15-
command: 'apt-get update && apt-get install -y gcc g++'
14+
name: Show versions
15+
command: 'g++ --version ; uname -a; cmake --version'
1616
- run:
17-
name: Install CMake
18-
command: 'apt-get update && sudo apt-get install -y cmake'
19-
- run:
20-
name: Create build files
17+
name: Run CMake
2118
command: 'mkdir build ; cd build ; cmake ..'
22-
- run:
23-
name: Versions
24-
command: 'g++ --version ; uname -a'
2519
- run:
2620
name: Compile
2721
command: 'cmake --build build'
2822
- run:
2923
name: Execute test suite
30-
command: 'cd build ; ctest -j 2'
24+
command: 'cd build ; ctest --output-on-failure -j 2'

Makefile

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ all:
3232
@echo "ChangeLog.md - generate ChangeLog file"
3333
@echo "check - compile and execute test suite"
3434
@echo "check-amalgamation - check whether sources have been amalgamated"
35-
@echo "check-fast - compile and execute test suite (skip long-running tests)"
3635
@echo "clean - remove built files"
3736
@echo "coverage - create coverage information with lcov"
38-
@echo "coverage-fast - create coverage information with fastcov"
3937
@echo "cppcheck - analyze code with cppcheck"
4038
@echo "cpplint - analyze code with cpplint"
4139
@echo "clang_tidy - analyze code with Clang-Tidy"
@@ -65,10 +63,6 @@ json_unit:
6563
check:
6664
$(MAKE) check -C test
6765

68-
# run unit tests and skip expensive tests
69-
check-fast:
70-
$(MAKE) check -C test TEST_PATTERN=""
71-
7266

7367
##########################################################################
7468
# coverage
@@ -77,21 +71,12 @@ check-fast:
7771
coverage:
7872
rm -fr build_coverage
7973
mkdir build_coverage
80-
cd build_coverage ; CXX=g++-8 cmake .. -GNinja -DJSON_Coverage=ON -DJSON_MultipleHeaders=ON
74+
cd build_coverage ; cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DJSON_Coverage=ON -DJSON_MultipleHeaders=ON
8175
cd build_coverage ; ninja
82-
cd build_coverage ; ctest -E '.*_default' -j10
76+
cd build_coverage ; ctest -j10
8377
cd build_coverage ; ninja lcov_html
8478
open build_coverage/test/html/index.html
8579

86-
coverage-fast:
87-
rm -fr build_coverage
88-
mkdir build_coverage
89-
cd build_coverage ; CXX=g++-9 cmake .. -GNinja -DJSON_Coverage=ON -DJSON_MultipleHeaders=ON
90-
cd build_coverage ; ninja
91-
cd build_coverage ; ctest -E '.*_default' -j10
92-
cd build_coverage ; ninja fastcov_html
93-
open build_coverage/test/html/index.html
94-
9580
##########################################################################
9681
# documentation tests
9782
##########################################################################
@@ -485,7 +470,7 @@ clang_sanitize:
485470
mkdir clang_sanitize_build
486471
cd clang_sanitize_build ; CXX=$(COMPILER_DIR)/clang++ cmake .. -DJSON_Sanitizer=On -DJSON_MultipleHeaders=ON -GNinja
487472
cd clang_sanitize_build ; ninja
488-
cd clang_sanitize_build ; ctest -E '.*_default' -j10
473+
cd clang_sanitize_build ; ctest -j10
489474

490475

491476
##########################################################################

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,6 @@ The library itself consists of a single header file licensed under the MIT licen
13501350
- [**cppcheck**](http://cppcheck.sourceforge.net) for static analysis
13511351
- [**doctest**](https://github.com/onqtam/doctest) for the unit tests
13521352
- [**Doxygen**](http://www.stack.nl/~dimitri/doxygen/) to generate [documentation](https://nlohmann.github.io/json/)
1353-
- [**fastcov**](https://github.com/RPGillespie6/fastcov) to process coverage information
13541353
- [**git-update-ghpages**](https://github.com/rstacruz/git-update-ghpages) to upload the documentation to gh-pages
13551354
- [**GitHub Changelog Generator**](https://github.com/skywinder/github-changelog-generator) to generate the [ChangeLog](https://github.com/nlohmann/json/blob/develop/ChangeLog.md)
13561355
- [**Google Benchmark**](https://github.com/google/benchmark) to implement the benchmarks

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@ test_script:
123123
# as it is extremely slow to run and cause
124124
# occasional timeouts on AppVeyor.
125125
# More info: https://github.com/nlohmann/json/pull/1570
126-
- if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode_all" -C "%configuration%" -V -j
126+
- if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" -V -j

benchmarks/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@ add_subdirectory(thirdparty/benchmark)
1414
include_directories(thirdparty)
1515
include_directories(${CMAKE_SOURCE_DIR}/../single_include)
1616

17-
# copy test files to build folder
18-
file(COPY ${CMAKE_SOURCE_DIR}/data DESTINATION .)
19-
file(COPY ${CMAKE_SOURCE_DIR}/../test/data/regression/floats.json
20-
${CMAKE_SOURCE_DIR}/../test/data/regression/unsigned_ints.json
21-
${CMAKE_SOURCE_DIR}/../test/data/regression/signed_ints.json
22-
${CMAKE_SOURCE_DIR}/../test/data/regression/small_signed_ints.json
23-
DESTINATION data/numbers)
17+
# download test data
18+
include(${CMAKE_SOURCE_DIR}/../cmake/download_test_data.cmake)
2419

2520
# benchmark binary
2621
add_executable(json_benchmarks src/benchmarks.cpp)
2722
target_compile_features(json_benchmarks PRIVATE cxx_std_11)
2823
target_link_libraries(json_benchmarks benchmark ${CMAKE_THREAD_LIBS_INIT})
24+
add_dependencies(json_benchmarks download_test_data)
25+
target_include_directories(json_benchmarks PRIVATE ${CMAKE_BINARY_DIR}/include)

benchmarks/data/jeopardy/jeopardy.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

benchmarks/data/nativejson-benchmark/canada.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)