Skip to content

Commit

Permalink
Release v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Dec 30, 2023
2 parents 69bae77 + c4d5c27 commit 28fea7c
Show file tree
Hide file tree
Showing 48 changed files with 2,467 additions and 124 deletions.
10 changes: 7 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
image:
- Visual Studio 2017
- Visual Studio 2022
- Visual Studio 2019
- Visual Studio 2017


init:
- git config --global core.autocrlf input
Expand Down Expand Up @@ -39,14 +40,17 @@ install:
- set COMMON_INSTALL_DIR=%BUILD_DIR%\install
- set COMMON_BUILD_TYPE=%CONFIGURATION%
- set COMMON_CXX_STANDARD=%CPP_STD%
- set GENERATOR="%CMAKE_GENERATOR%"
- set PLATFORM="%CMAKE_PLATFORM%"
- call script\prepare_externals.bat

build_script:
- echo ------------------------- Building Project -------------------------
- cd %BUILD_DIR%
- cmake .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "NMake Makefiles" -DBOOST_ROOT="%BOOST_DIR%" ^
- if NOT [%PLATFORM%] == [] set PLATFORM_PARAM=-A %PLATFORM%
- cmake .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%CMAKE_GENERATOR%" %PLATFORM_PARAM% -DBOOST_ROOT="%BOOST_DIR%" ^
-DBoost_USE_STATIC_LIBS=ON -DCMAKE_CXX_STANDARD=%CPP_STD% -DCMAKE_INSTALL_PREFIX=install ^
-DCMAKE_PREFIX_PATH="%COMMON_INSTALL_DIR%" -DCC_MQTT5_BUILD_UNIT_TESTS=ON ^
-DCMAKE_PREFIX_PATH="%COMMON_INSTALL_DIR%" -DCC_MQTT5_BUILD_UNIT_TESTS=ON -DCC_MQTT5_CLIENT_AFL_FUZZ=ON ^
-DCC_MQTT5_CUSTOM_CLIENT_CONFIG_FILES=%APPVEYOR_BUILD_FOLDER%/client/lib/script/BareMetalConfig.cmake
- cmake --build . --config %CONFIGURATION% --target install --parallel %NUMBER_OF_PROCESSORS%

Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ jobs:
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install -DCMAKE_CXX_STANDARD=${{matrix.cpp}} \
-DCC_MQTT5_WITH_SANITIZERS=ON -DCC_MQTT5_BUILD_UNIT_TESTS=ON -DCC_MQTT5_BUILD_INTEGRATION_TESTS=ON \
-DCC_MQTT5_CUSTOM_CLIENT_CONFIG_FILES=$GITHUB_WORKSPACE/client/lib/script/BareMetalConfig.cmake
-DCC_MQTT5_WITH_DEFAULT_SANITIZERS=ON \
-DCC_MQTT5_BUILD_UNIT_TESTS=ON -DCC_MQTT5_BUILD_INTEGRATION_TESTS=ON \
-DCC_MQTT5_CUSTOM_CLIENT_CONFIG_FILES=$GITHUB_WORKSPACE/client/lib/script/BareMetalConfig.cmake \
-DCC_MQTT5_CLIENT_AFL_FUZZ=ON
env:
CC: gcc-${{matrix.cc_ver}}
CXX: g++-${{matrix.cc_ver}}
Expand Down Expand Up @@ -118,8 +120,10 @@ jobs:
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install -DCMAKE_CXX_STANDARD=${{matrix.cpp}} \
-DCC_MQTT5_WITH_SANITIZERS=ON -DCC_MQTT5_BUILD_UNIT_TESTS=ON -DCC_MQTT5_BUILD_INTEGRATION_TESTS=ON \
-DCC_MQTT5_CUSTOM_CLIENT_CONFIG_FILES=$GITHUB_WORKSPACE/client/lib/script/BareMetalConfig.cmake
-DCC_MQTT5_WITH_DEFAULT_SANITIZERS=ON \
-DCC_MQTT5_BUILD_UNIT_TESTS=ON -DCC_MQTT5_BUILD_INTEGRATION_TESTS=ON \
-DCC_MQTT5_CUSTOM_CLIENT_CONFIG_FILES=$GITHUB_WORKSPACE/client/lib/script/BareMetalConfig.cmake \
-DCC_MQTT5_CLIENT_AFL_FUZZ=ON
env:
CC: clang-${{matrix.cc_ver}}
CXX: clang++-${{matrix.cc_ver}}
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ project ("cc_mqtt5_libs")
# Options
option (CC_MQTT5_CLIENT_DEFAULT_LIB "Build and install default variant of MQTT5 client library" ON)
option (CC_MQTT5_CLIENT_APPS "Build and install client applications" ${CC_MQTT5_CLIENT_DEFAULT_LIB})
option (CC_MQTT5_CLIENT_AFL_FUZZ "Build and install client AFL++ fuzzing application" OFF)
option (CC_MQTT5_WARN_AS_ERR "Treat warning as error" ON)
option (CC_MQTT5_USE_CCACHE "Use ccache on unix system" ON)
option (CC_MQTT5_BUILD_UNIT_TESTS "Build unit tests" OFF)
option (CC_MQTT5_BUILD_INTEGRATION_TESTS "Build integration tests which require MQTT broker on local port 1883." OFF)
option (CC_MQTT5_WITH_SANITIZERS "Build with sanitizers" OFF)
option (CC_MQTT5_WITH_DEFAULT_SANITIZERS "Build with sanitizers" OFF)

# Extra Configuration Variables
# CC_MQTT5_CUSTOM_CLIENT_CONFIG_FILES - List of custom client configuration files
Expand All @@ -18,6 +19,8 @@ set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use")

##########################################################################

cmake_policy(SET CMP0079 NEW)

set (CC_MQTT5_EXTERNALS_DIR "${PROJECT_SOURCE_DIR}/externals")

# Dependencies
Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Overview
This repository provides **single threaded**, **asynchronous**, **non-blocking**, easy to
use, suitable for **embedded** platforms, well documented MQTT5 client library.
It is completely generic and allows end application to have a complete control
This repository provides well documented and easy to use MQTT5 client library.
It is:

- single threaded
- asynchronous and non-blocking,
- fuzz testable
- compile time configurable (disable unneeded features and/or configure some data types)
- suitable for **embedded** platforms with limited resources and/or without heap

The library is completely generic and allows end application to have a complete control
over the I/O link as well as perform extra manipulation on the exchanged
raw data (such as encryption or extra framing).

Expand Down Expand Up @@ -43,6 +50,16 @@ the events loop and manage network connection(s)).
Detailed instructions on how to build and install all the components can be
found in [doc/BUILD.md](doc/BUILD.md) file.

# How to Fuzz Test
The provided MQTT5 client library as well as its dependencies from the
[CommsChampion Ecosystem](https://commschamp.github.io/) have been designed with
reliability in mind and to be able to safely handle malformed data as well as
withstand unexpected behaviour from a MQTT broker. In order to
verify the library's reliability it is highly recommended to perform
[AFL++](https://github.com/AFLplusplus/AFLplusplus) based fuzz testing.
The detailed instruction on how to fuzz test the
library can be found in [doc/fuzz_test.md](doc/fuzz_test.md) file.

# Branching Model
This repository will follow the
[Successful Git Branching Model](http://nvie.com/posts/a-successful-git-branching-model/).
Expand Down
3 changes: 2 additions & 1 deletion client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
add_subdirectory (lib)
add_subdirectory (app)
add_subdirectory (app)
add_subdirectory (afl_fuzz)
Loading

0 comments on commit 28fea7c

Please sign in to comment.