8000 Revamping binary serialize · connectivecpp/binary-serialize@71737ea · GitHub
[go: up one dir, main page]

Skip to content

Commit 71737ea

Browse files
Revamping binary serialize
1 parent 596aecb commit 71737ea

File tree

3 files changed

+80
-10
lines changed

3 files changed

+80
-10
lines changed

README.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,62 @@
1-
# binary-serialize
2-
A minimal library for binary serialization, using compile time specifier strings similar to std::format
1+
# Binary Serialize, Header-Only C++ 20 Binary Serialization Classes and Functions
2+
3+
#### Unit Test and Documentation Generation Workflow Status
4+
5+
![GH Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/connectivecpp/binary-serialize/build_run_unit_test_cmake.yml?branch=main&label=GH%20Actions%20build,%20unit%20tests%20on%20main)
6+
7+
![GH Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/connectivecpp/binary-serialize/build_run_unit_test_cmake.yml?branch=develop&label=GH%20Actions%20build,%20unit%20tests%20on%20develop)
8+
9+
![GH Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/connectivecpp/binary-serialize/gen_docs.yml?branch=main&label=GH%20Actions%20generate%20docs)
10+
11+
![GH Tag](https://img.shields.io/github/v/tag/connectivecpp/binary-serialize?label=GH%20tag)
12+
13+
## Overview
14+
15+
The
16+
17+
## Generated Documentation
18+
19+
The generated Doxygen documentation for `binary_serialize` is [here](https://connectivecpp.github.io/binary-serialize/).
20+
21+
## Dependencies
22+
23+
The `binary_serialize` header file does not have any third-party dependencies. It uses C++ standard library headers only. The unit test code does have dependencies as noted below.
24+
25+
## C++ Standard
26+
27+
`binary_serialize` uses C++ 20 features, including ... (fill in details here) ... the "spaceship" operator (`<=>`), `std::span`, and `concepts` / `requires`.
28+
29+
## Supported Compilers
30+
31+
Continuous integration workflows build and unit test on g++ (through Ubuntu), MSVC (through Windows), and clang (through macOS).
32+
33+
## Unit Test Dependencies
34+
35+
The unit test code uses [Catch2](https://github.com/catchorg/Catch2). If the `BINARY_SERIALIZE_BUILD_TESTS` flag is provided to Cmake (see commands below) the Cmake configure / generate will download the Catch2 library as appropriate using the [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) dependency manager. If Catch2 (v3 or greater) is already installed using a different package manager (such as Conan or vcpkg), the `CPM_USE_LOCAL_PACKAGES` variable can be set which results in `find_package` being attempted. Note that v3 (or later) of Catch2 is required.
36+
37+
The unit test uses utilities from Connective C++'s [utility-rack](https://github.com/connectivecpp/utility-rack).
38+
39+
Specific version (or branch) specs for the dependenies are in `test/CMakeLists.txt`.
40+
41+
## Build and Run Unit Tests
42+
43+
To build and run the unit test program:
44+
45+
First clone the `binary-serialize` repository, then create a build directory in parallel to the `binary-serialize` directory (this is called "out of source" builds, which is recommended), then `cd` (change directory) into the build directory. The CMake commands:
46+
47+
```
48+
cmake -D BINARY_SERIALIZE_BUILD_TESTS:BOOL=ON ../binary-serialize
49+
50+
cmake --build .
51+
52+
ctest
53+
```
54+
55+
For additional test output, run the unit test individually, for example:
56+
57+
```
58+
test/binary_serialize_test -s
59+
```
60+
61+
The example can be built by adding `-D BINARY_SERIALIZE_BUILD_EXAMPLES:BOOL=ON` to the CMake configure / generate step.
62+

test/CMakeLists.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff l 8000 ine change
@@ -8,23 +8,27 @@ cmake_minimum_required ( VERSION 3.14 FATAL_ERROR )
88
# create project
99
project ( binary_serialize_test LANGUAGES CXX )
1010

11-
# add executable
12-
add_executable ( binary_serialize_test binary_serialize_test.cpp )
13-
target_compile_features ( binary_serialize_test PRIVATE cxx_std_20 )
14-
1511
# add dependencies
1612
include ( ../cmake/download_cpm.cmake )
1713

1814
CPMAddPackage ( "gh:catchorg/Catch2@3.5.4" )
1915
CPMAddPackage ( "gh:connectivecpp/utility-rack@1.0.0" )
2016

21-
# link dependencies
22-
target_link_libraries ( binary_serialize_test PRIVATE utility_rack Catch2::Catch2WithMain )
17+
set ( test_app_names extract_append_test
18+
binary_serialize_test )
19+
# add executable
20+
foreach ( test_app_name IN LISTS test_app_name )
21+
add_executable ( ${test_app_name} ${test_app_name}.cpp )
22+
target_compile_features ( ${test_app_name} PRIVATE cxx_std_20 )
23+
target_link_libraries ( ${test_app_name} PRIVATE utility_rack Catch2::Catch2WithMain )
24+
endforeach()
2325

2426
enable_testing()
2527

26-
add_test ( NAME run_binary_serialize_test COMMAND binary_serialize_test )
27-
set_tests_properties ( run_binary_serialize_test
28+
foreach ( test_app_name IN LISTS test_app_name )
29+
add_test ( NAME run_${test_app_name} COMMAND ${test_app_name} )
30+
set_tests_properties ( run_${test_app_name}
2831
PROPERTIES PASS_REGULAR_EXPRESSION "All tests passed"
2932
)
33+
endforeach()
3034

test/binary_serialize_test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <array>
2222
#include <optional>
2323

24+
/*
2425
#include "marshall/marshall.hpp"
2526
#include "marshall/shared_buffer.hpp"
2627
@@ -121,3 +122,8 @@ TEMPLATE_TEST_CASE ( "Marshall ", "[marshall] [shared_buffer]",
121122
122123
}
123124
125+
*/
126+
127+
TEST_CASE ( "Placeholder", "[placeholder]" ) {
128+
REQUIRE (true);
129+
}

0 commit comments

Comments
 (0)
0