@@ -28,111 +28,6 @@ format to store user input files.
28
28
* ` 0.y.z ` can be used with older compilers.
29
29
* Major versions maintain binary-compatibility.
30
30
31
- ## Contributing to JsonCpp
32
-
33
- ### Building
34
-
35
- Both CMake and Meson tools are capable of generating a variety of build environments for you preferred development environment.
36
- Using cmake or meson you can generate an XCode, Visual Studio, Unix Makefile, Ninja, or other environment that fits your needs.
37
-
38
- An example of a common Meson/Ninja environment is described next.
39
-
40
- ### Building and testing with Meson/Ninja
41
- Thanks to David Seifert (@SoapGentoo ), we (the maintainers) now use
42
- [ meson] ( http://mesonbuild.com/ ) and [ ninja] ( https://ninja-build.org/ ) to build
43
- for debugging, as well as for continuous integration (see
44
- [ ` ./travis_scripts/meson_builder.sh ` ] ( ./travis_scripts/meson_builder.sh ) ). Other systems may work, but minor
45
- things like version strings might break.
46
-
47
- First, install both meson (which requires Python3) and ninja.
48
- If you wish to install to a directory other than /usr/local, set an environment variable called DESTDIR with the desired path:
49
- DESTDIR=/path/to/install/dir
50
-
51
- Then,
52
-
53
- cd jsoncpp/
54
- BUILD_TYPE=debug
55
- #BUILD_TYPE=release
56
- LIB_TYPE=shared
57
- #LIB_TYPE=static
58
- meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}
59
- #ninja -v -C build-${LIB_TYPE} test # This stopped working on my Mac.
60
- ninja -v -C build-${LIB_TYPE}
61
- cd build-${LIB_TYPE}
62
- meson test --no-rebuild --print-errorlogs
63
- sudo ninja install
64
-
65
- ### Building and testing with other build systems
66
- See https://github.com/open-source-parsers/jsoncpp/wiki/Building
67
-
68
- ### Running the tests manually
69
-
70
- You need to run tests manually only if you are troubleshooting an issue.
71
-
72
- In the instructions below, replace ` path/to/jsontest ` with the path of the
73
- ` jsontest ` executable that was compiled on your platform.
74
-
75
- cd test
76
- # This will run the Reader/Writer tests
77
- python runjsontests.py path/to/jsontest
78
-
79
- # This will run the Reader/Writer tests, using JSONChecker test suite
80
- # (http://www.json.org/JSON_checker/).
81
- # Notes: not all tests pass: JsonCpp is too lenient (for example,
82
- # it allows an integer to start with '0'). The goal is to improve
83
- # strict mode parsing to get all tests to pass.
84
- python runjsontests.py --with-json-checker path/to/jsontest
85
-
86
- # This will run the unit tests (mostly Value)
87
- python rununittests.py path/to/test_lib_json
88
-
89
- # You can run the tests using valgrind:
90
- python rununittests.py --valgrind path/to/test_lib_json
91
-
92
- ### Building the documentation
93
-
94
- Run the Python script ` doxybuild.py ` from the top directory:
95
-
96
- python doxybuild.py --doxygen=$(which doxygen) --open --with-dot
97
-
98
- See ` doxybuild.py --help ` for options.
99
-
100
- ### Adding a reader/writer test
101
-
102
- To add a test, you need to create two files in test/data:
103
-
104
- * a ` TESTNAME.json ` file, that contains the input document in JSON format.
105
- * a ` TESTNAME.expected ` file, that contains a flatened representation of the
106
- input document.
107
-
108
- The ` TESTNAME.expected ` file format is as follows:
109
-
110
- * Each line represents a JSON element of the element tree represented by the
111
- input document.
112
- * Each line has two parts: the path to access the element separated from the
113
- element value by ` = ` . Array and object values are always empty (i.e.
114
- represented by either ` [] ` or ` {} ` ).
115
- * Element path ` . ` represents the root element, and is used to separate object
116
- members. ` [N] ` is used to specify the value of an array element at index ` N ` .
117
-
118
- See the examples ` test_complex_01.json ` and ` test_complex_01.expected ` to better understand element paths.
119
-
120
- ### Understanding reader/writer test output
121
-
122
- When a test is run, output files are generated beside the input test files. Below is a short description of the content of each file:
123
-
124
- * ` test_complex_01.json ` : input JSON document.
125
- * ` test_complex_01.expected ` : flattened JSON element tree used to check if
126
- parsing was corrected.
127
- * ` test_complex_01.actual ` : flattened JSON element tree produced by ` jsontest `
128
- from reading ` test_complex_01.json ` .
129
- * ` test_complex_01.rewrite ` : JSON document written by ` jsontest ` using the
130
- ` Json::Value ` parsed from ` test_complex_01.json ` and serialized using
131
- ` Json::StyledWritter ` .
132
- * ` test_complex_01.actual-rewrite ` : flattened JSON element tree produced by
133
- ` jsontest ` from reading ` test_complex_01.rewrite ` .
134
- * ` test_complex_01.process-output ` : ` jsontest ` output, typically useful for
135
- understanding parsing errors.
136
31
137
32
## Using JsonCpp in your project
138
33
0 commit comments