Skip to content

Commit e51edb7

Browse files
Added a separate README for building the tests
1 parent 1a19c7c commit e51edb7

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Compiling and running the tests
2+
3+
reflect-cpp uses vcpkg for dependency management, including
4+
gtest, which is required for the tests.
5+
6+
```bash
7+
# bootstrap vcpkg if you haven't done so already
8+
git submodule update --init
9+
./vcpkg/bootstrap-vcpkg.sh # Linux, macOS
10+
./vcpkg/bootstrap-vcpkg.bat # Windows
11+
# You may be prompted to install additional dependencies.
12+
```
13+
14+
## JSON only
15+
16+
To compile the tests, do the following:
17+
18+
```bash
19+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DREFLECTCPP_BUILD_TESTS=ON
20+
cmake --build build -j 4 # gcc, clang
21+
cmake --build build --config Release -j 4 # MSVC
22+
```
23+
24+
To run the tests, do the following:
25+
26+
```
27+
./build/tests/json/reflect-cpp-json-tests
28+
```
29+
30+
## All serialization formats
31+
32+
To compile the tests with serialization formats other than JSON, do the following:
33+
34+
```bash
35+
cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_UBJSON=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release
36+
cmake --build build -j 4 # gcc, clang
37+
cmake --build build --config Release -j 4 # MSVC
38+
```
39+
40+
To run the tests, do the following:
41+
42+
```
43+
./build/tests/bson/reflect-cpp-bson-tests
44+
./build/tests/cbor/reflect-cpp-cbor-tests
45+
./build/tests/flexbuffers/reflect-cpp-flexbuffers-tests
46+
./build/tests/msgpack/reflect-cpp-msgpack-tests
47+
./build/tests/json/reflect-cpp-json-tests
48+
./build/tests/toml/reflect-cpp-toml-tests
49+
./build/tests/toml/reflect-cpp-ubjson-tests
50+
./build/tests/xml/reflect-cpp-xml-tests
51+
./build/tests/yaml/reflect-cpp-yaml-tests
52+
```

0 commit comments

Comments
 (0)