Skip to content

Commit 885c91d

Browse files
authored
Adding example_json test (#1490)
1 parent 3f26a91 commit 885c91d

File tree

4 files changed

+520
-1
lines changed

4 files changed

+520
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ BEVE size: 611 bytes
8080

8181
*BEVE packs more efficiently than JSON, so transporting the same data is even faster.
8282

83-
## Example
83+
## Examples
84+
85+
> [!TIP]
86+
>
87+
> See the [example_json](https://github.com/stephenberry/glaze/blob/main/tests/example_json/example_json.cpp) unit test for basic examples of how to use Glaze. See [json_test](https://github.com/stephenberry/glaze/blob/main/tests/json_test/json_test.cpp) for an extensive test of features.
8488
8589
Your struct will automatically get reflected! No metadata is required by the user.
8690

tests/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ add_subdirectory(cli_menu_test)
5959
add_subdirectory(compare_test)
6060
add_subdirectory(csv_test)
6161
add_subdirectory(eigen_test)
62+
add_subdirectory(example_json)
6263
add_subdirectory(exceptions_test)
6364
add_subdirectory(int_parsing)
6465
add_subdirectory(json_conformance)

tests/example_json/CMakeLists.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
project(example_json)
2+
3+
add_executable(${PROJECT_NAME} ${PROJECT_NAME}.cpp)
4+
5+
target_link_libraries(${PROJECT_NAME} PRIVATE glz_test_common)
6+
7+
if (MINGW)
8+
target_compile_options(${PROJECT_NAME} PRIVATE "-Wa,-mbig-obj")
9+
endif ()
10+
11+
add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME})
12+
13+
target_code_coverage(${PROJECT_NAME} AUTO ALL)
14+

0 commit comments

Comments
 (0)