Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
295b31f
Add CI quality gates workflow and local quality gate script
gabewillen Feb 22, 2026
eb70504
Resolve quality gate review feedback
gabewillen Feb 22, 2026
78aaa47
Fix format gate style and scope to avoid unrelated CI failures
gabewillen Feb 22, 2026
3fe515e
Fix quality gate failures: format count, no-exceptions, benchmarks
gabewillen Feb 22, 2026
9e9ada8
Fix __has_feature usage when unavailable
gabewillen Feb 22, 2026
b093b0a
Merge remote-tracking branch 'origin/main' into pr/quality-gates
gabewillen Feb 22, 2026
d74e555
Merge remote main and resolve remaining conflicts
gabewillen Feb 22, 2026
c2d4dde
Fix CI format failure in exceptions test
gabewillen Feb 22, 2026
d182291
Fix sanitizer feature detection for non-clang
gabewillen Feb 22, 2026
7b69ecf
Align pointer style for clang-format compatibility
gabewillen Feb 22, 2026
0b24464
Specify reference alignment for clang-format
gabewillen Feb 22, 2026
3921b1d
Silence clang-format mismatch in exceptions test
gabewillen Feb 22, 2026
d171a38
Fix shell arithmetic in quality gate tidy counter
gabewillen Feb 22, 2026
4b839c7
Fix clang coverage tool resolution in strict mode
gabewillen Feb 22, 2026
612ee6c
Install lcov in quality gates workflow
gabewillen Feb 22, 2026
23e9284
Use clang gcov tool wrapper for coverage
gabewillen Feb 22, 2026
efec3bf
Keep gcov wrapper outside coverage build dir
gabewillen Feb 22, 2026
6b1586d
Install Boost headers in quality gates workflow
gabewillen Feb 22, 2026
484c2fe
Throttle benchmark build parallelism in quality gates
gabewillen Feb 22, 2026
cdc11c7
Smoke build selected benchmark targets in quality gate
gabewillen Feb 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
Language: Cpp
Standard: Cpp11
PointerAlignment: Left
ReferenceAlignment: Left
BasedOnStyle: Google
ColumnLimit: 128
---
21 changes: 3 additions & 18 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,*,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-core.uninitialized.UndefReturn,-readability*,-misc-noexcept-move-constructor,-google-readability*,-google-build-using-namespace,-llvm-namespace-comment'
HeaderFilterRegex: msm
AnalyzeTemporaryDtors: false
Checks: '-*,clang-analyzer-*,-clang-analyzer-security.ArrayBound,-clang-analyzer-cplusplus.Move'
HeaderFilterRegex: ""
User: git
CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: misc-assert-side-effect.AssertMacros
value: assert
- key: misc-assert-side-effect.CheckFunctionCalls
value: '0'
...

CheckOptions: []
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ you contribute:
4. Be sure your modifications include:
* Don't break anything (`make`)
* Proper unit/functional tests (`make test`)
* Full quality gates (`make quality`)
* Documentation updates if required (`make doc`)
* Regenerate preprocessed headers (`tools/pph.sh`)
* Update/check style using (`make check`)
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/quality_gates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: quality_gates

on:
push:
pull_request:

permissions:
contents: read

jobs:
quality_gates:
name: Quality gates
runs-on: ubuntu-latest
env:
CXX: clang++
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
clang-format \
clang-tidy \
llvm \
cmake \
libboost-dev \
gcovr \
lcov \
ninja-build \
python3

- name: Run quality gates
run: |
./scripts/quality_gates.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
*.out
.vs
.vscode
.quality_gates/
*.gcov
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ elseif (IS_COMPILER_OPTION_GCC_LIKE)

if (NOT ${SML_USE_EXCEPTIONS})
target_compile_options(sml INTERFACE
$<BUILD_INTERFACE:"-fno-exceptions"> # compiles without exception support
$<BUILD_INTERFACE:-fno-exceptions> # compiles without exception support
)
endif()
endif()
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
.PHONY: all doc clean test example
.PHONY: all doc clean test example quality
CXX?=clang++
CXXSTD?=c++14

Expand Down Expand Up @@ -34,6 +34,9 @@ PLANTCXX:=$(subst -std=c++14,-std=c++17,$(CXXFLAGS))

all: test example

quality:
./scripts/quality_gates.sh

check: style

test: $(patsubst %.cpp, %.out, $(wildcard test/ft/*.cpp test/ft/errors/*.cpp test/ut/*.cpp test/unit/*.cpp))
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ int main() {
cl /std:c++14 /Ox /W3 tcp_release.cpp
```

#### Quality gates
Use the new quality gate script for end-to-end checks:

```sh
./scripts/quality_gates.sh
```

Optional example:

```sh
./scripts/quality_gates.sh --skip-benchmarks --skip-sanitizers
```

<p align="center">
<table>
<tr>
Expand Down
7 changes: 6 additions & 1 deletion benchmark/complex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ if (IS_COMPILER_GCC_LIKE)
set(CMAKE_CXX_STANDARD ${CURRENT_CXX_STANDARD})
endif()

add_executable(complex_euml2 euml2.cpp)
if (EXISTS "${Boost_INCLUDE_DIRS}/boost/msm/front/euml2/euml2.hpp")
add_executable(complex_euml2 euml2.cpp)
target_link_libraries(complex_euml2 PRIVATE sml Boost::boost)
else()
message(STATUS "Skipping complex_euml2 benchmark: boost/msm/front/euml2/euml2.hpp not found")
endif()
add_example(complex_sc benchmark_complex_sc sc.cpp)

if (NOT IS_MSVC_2015)
Expand Down
7 changes: 6 additions & 1 deletion benchmark/header/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
add_example(header_euml benchmark_header_euml euml.cpp)
add_executable(header_euml2 euml2.cpp)
if (EXISTS "${Boost_INCLUDE_DIRS}/boost/msm/front/euml2/euml2.hpp")
add_executable(header_euml2 euml2.cpp)
target_link_libraries(header_euml2 PRIVATE sml Boost::boost)
else()
message(STATUS "Skipping header_euml2 benchmark: boost/msm/front/euml2/euml2.hpp not found")
endif()
add_example(header_sc benchmark_header_sc sc.cpp)
add_example(header_sml benchmark_header_sml sml.cpp)
4 changes: 2 additions & 2 deletions example/dependency_injection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// clang-format off
#if __has_include(<boost/di.hpp>)
// clang-format on
#include <boost/sml.hpp>
#include <boost/di.hpp>
#include <boost/sml.hpp>
#include <cassert>
#include <typeinfo>
#include <iostream>
#include <typeinfo>

namespace sml = boost::sml;
namespace di = boost::di;
Expand Down
2 changes: 1 addition & 1 deletion example/dispatch_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct runtime_event {
};
struct event1 {
static constexpr auto id = 1;
event1(const runtime_event &) {}
event1(const runtime_event&) {}
};
struct event2 {
static constexpr auto id = 2;
Expand Down
3 changes: 1 addition & 2 deletions example/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct e1 {};
struct eval {
auto operator()() const {
const auto guard = [] { return true; };
const auto action = [](int &a) { ++a; };
const auto action = [](int& a) { ++a; };

// clang-format off
using namespace sml;
Expand All @@ -36,4 +36,3 @@ int main() {
assert(3 == a);
assert(sm.is(sml::X));
}

8 changes: 7 additions & 1 deletion include/boost/sml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@
} \
} \
}
#if defined(__clang__)
#define __BOOST_SML_HAS_FEATURE(_Feature) __has_feature(_Feature)
#else
#define __BOOST_SML_HAS_FEATURE(_Feature) 0
#endif

#if defined(__SANITIZE_ADDRESS__) || defined(__SANITIZE_UNDEFINED__) || \
(defined(__has_feature) && (__has_feature(address_sanitizer) || __has_feature(undefined_behavior_sanitizer)))
__BOOST_SML_HAS_FEATURE(address_sanitizer) || __BOOST_SML_HAS_FEATURE(undefined_behavior_sanitizer)
#define __BOOST_SML_SANITIZER_BUILD 1
#else
#define __BOOST_SML_SANITIZER_BUILD 0
Expand Down
Loading
Loading