Repository navigation
Releases
SpecLab v0.4.0
SpecLab v0.4.0
A minor release: it adds a public overload. Every call that compiled against 0.3.0 still
compiles, but speclab::Test<State> is now an overload set rather than a single function, so
naming it without calling it - &speclab::Test<MyState>, or binding it to auto - no longer
deduces and needs an explicit function type. No in-tree code did that, and MduX does not either.
Added
speclab::Test<State>(id)is now its own overload, andStatefulTestBuildergained a
constructor that builds the shared state in place. AStatethat is neither copyable nor
movable - one holding an RAII handle such as a scoped temporary directory, a file handle or a
lock - can now be used (#32). Previously the single factory'sState initial = State{}default
argument was materialised and then moved, so the state had to be movable even in the form that
only ever default-constructs it. The two-argumentTest<State>(id, initial)keeps its by-value
parameter, where moving is unavoidable.- A self-test with a deliberately immovable state, which fails to compile without the overload.
Important
SpecLab is an experimental project. Its compliance features are conceptual and educational: using it does not make software compliant with IEC 62304, ISO 13485 or ISO 14971, and it is not recommended for production use.
Release tags are immutable. v0.4.0 points at d85c1f7 and will not be moved. Each package has a matching SHA-256 checksum file. The packages were built by this workflow run.
SpecLab v0.3.0
SpecLab v0.3.0
A minor release, not a patch: it adds public API and changes the signatures of
RequirementRegistry's accessors. The exported free functions of
speclab.core.requirements are unchanged.
Added
RequirementBuilder::Test(id)andRequirementBuilder::SetEnabled(bool).speclab::core::ClearRequirementTestLinks,NormalizeRiskLevelandNormalizeSafetyClass.- A ThreadSanitizer CI leg (
linux-tsan), which runs the self-tests with
TSAN_OPTIONS=halt_on_error=1.
Fixed
- The
Requirement,FeatureandIEC62304Processbuilders now run tests (#25). Their
Execute()returned an empty vector: nothing ran, and a caller counting failures saw none, so a
suite that looked complete reported no failure. Now:RequirementBuilder::Test(id)attaches a test and returns itsTestBuilder.Execute()runs
each one and returns its result, with the requirement's metadata and id attached.Execute()registers the requirement and its test links (includingAssociateTestids) in the
requirement registry, soExportTraceMatrixCSV/HTMLand theREQUIREMENT_COVERAGEgate see
them.- A requirement with no test of its own returns one
Blockedresult instead of an empty list; a
disabled one returnsSkipped.FeatureandIEC62304ProcessreportBlockedwhen they hold
no requirement.
- The requirement registry is now locked. It is a process-wide singleton that
TestSuitereads
from parallel test threads whileRequirement::Execute()writes to it, which was a data race
on itsunordered_maps (confirmed by ThreadSanitizer). Its accessors that used to return
pointers into those maps (getRequirement,getRequirementsForTest,getAllRequirements,
getUncoveredHighRisk,getUncoveredCritical) now return values; the free functions are
unchanged. RegisterRequirementupdates an existing record instead of keeping the first one. A risk level
raised between two registrations now reaches the coverage gate.- Coverage links are rebuilt from what each execution actually ran. A requirement only counts
as covered by tests that ran and were not skipped, plus the ids given toAssociateTest(which
run elsewhere). This closes three ways a requirement could look covered with nothing verified:
a requirement disabled after an execution kept the links of that earlier run; a disabled
attached test (Test("T").SetEnabled(false)) was linked anyway; and a requirement with no test
at all was linked to its own synthetic result. - Risk levels and safety classes are normalised (
NormalizeRiskLevel,NormalizeSafetyClass).
The builders documentRiskLevel("Critical")andSafetyClass("ClassC"), but the coverage gate
compares againstCRITICALandCLASS_C, so those spellings produced no critical gap. FeatureBuilder::Requirement(),IEC62304ProcessBuilder::Requirement()and the new
RequirementBuilder::Test()return references into their containers, which are nowstd::deque.
Withstd::vector, adding the next requirement or test invalidated a reference the caller still
held.
Important
SpecLab is an experimental project. Its compliance features are conceptual and educational: using it does not make software compliant with IEC 62304, ISO 13485 or ISO 14971, and it is not recommended for production use.
Release tags are immutable. v0.3.0 points at 3985227 and will not be moved. Each package has a matching SHA-256 checksum file. The packages were built by this workflow run.
SpecLab v0.2.0
SpecLab v0.2.0
Added
- The APIs MduX had to write in its
tests/framework/SpecLabBridge.hpp, so that header can forward
to SpecLab:speclab::Registerandspeclab::runMain(new modulespeclab.runners.discovery):
registration without macros, and a runner implementing--list-tests(name<TAB>labels) and
--run=<name>, with the bridge's exit codes and output, byte for byte. An unknown name is an
error, not a pass.speclab::core::Checks: collects several failed expectations and reports them in one
AssertionFailure, each with itsfile:line.speclab::Test<State>(id[, initial]): Given/When/Then steps that receive a shared
State&, which outlivesExecute(). This replaces thestd::shared_ptr<State>idiom. Steps
may still bevoid(). With MSVC 19.44 (VS 2022),Statemust be declared at namespace scope:
a function-local type makes that compiler crash (C1001) or leave symbols undefined (C5046).Assertions::require(condition, "format {}", args…): a compile-time-checked format
string, formatted only on failure, with the caller'ssource_location.
- Self-tests (
tests/), run bycteston every CI leg: one CTest entry per scenario
(discovered with--list-tests, with labels), pluscontract.*tests that check the exit code
and the exact output ofrunMain.SPECLAB_BUILD_TESTSnow defaults to on only when
SpecLab is the top-level project.
Changed
assertEqualandassertNotEqualaccept two different types (anintliteral against a
std::size_t, or a string literal against astd::string). Integers are compared with
std::cmp_equal, so-1no longer risks equallingSIZE_MAX, and callers get no
sign-conversion warnings.booland the character types (char,wchar_t,char8_t,
char16_t,char32_t) are rejected bystd::cmp_equal, so they are compared with==.AssertionFailure::formatLocation(), and thereforeTestResult::errorDetails, reports the
source file by name instead of by absolute path. The output is now identical on every machine;
location()still has the full path.- GitHub release notes are built from this file's section for the tag, followed by the
experimental-project disclaimer, instead of a fixed template. The template claimed regulatory
"validation" and linked to documentation that does not exist. The release job fails if the
section is missing or empty.
Fixed
RequirementAPI.cppmforward-declaredParameterizedTestBuilder, which is attached to another
module. Clang rejects that ("cannot be attached to other modules") in any translation unit that
usesParameterizedTest. The declaration was unused and is removed.
Important
SpecLab is an experimental project. Its compliance features are conceptual and educational: using it does not make software compliant with IEC 62304, ISO 13485 or ISO 14971, and it is not recommended for production use.
Release tags are immutable. v0.2.0 points at 5ca3dd8 and will not be moved. Each package has a matching SHA-256 checksum file. The packages were built by this workflow run.
SpecLab v0.1.2
SpecLab v0.1.2
This release fixes sanitizer builds for consumers and adds macOS on Apple Silicon. The test API is unchanged.
Highlights
- Sanitizer builds of consumers fixed. In v0.1.1,
-fsanitize=…was not passed on to code that doesimport speclab;. When that code was left uninstrumented, GCC 16 crashed with an internal compiler error (expand_UBSAN_NULL). The flag is now PUBLIC onspeclab, for compiling and linking, in the build tree and in the installed package. - macOS on Apple Silicon. It is supported with upstream LLVM/Clang 21.1.8 and libc++ (
brew install llvm@21 ninja, then--toolchain cmake/toolchains/macos-arm64-llvm.cmake), and CI builds it onmacos-15. On macOS, AppleClang and non-arm64 targets (including universalarm64;x86_64builds) are now refused at configure time with a clear message. - Both Clang toolchain files reject a conflicting
-stdlib=anywhere inCMAKE_CXX_FLAGS. - README rewritten against the actual API, with per-platform CI badges. Every example is compiled with
-Wall -Wextra -Werrorand run. TheRequirement/Feature/IEC62304Processbuilders are documented as metadata-only: theirExecute()runs no test (#25). - CI:
- The release workflow can now create the GitHub release itself.
- The Security workflow publishes its CodeQL and Trivy results again.
aquasecurity/trivy-actionis pinned by commit.
See CHANGELOG.md for details.
Supported platforms (all built in CI)
- Windows x64 / x86: MSVC 17.10+
- Linux x64:
- GCC 16.1.0, with CMake 4.1.1, 4.3.1 or 4.4.2
- Clang 21 + libc++
- macOS Apple Silicon: Clang 21.1.8 + libc++
- CMake 4.0 to 4.4. GCC 16.2.0 is not usable (#17).
Important
SpecLab is an experimental project. Its compliance features are conceptual and educational: using it does not make software compliant with IEC 62304, ISO 13485 or ISO 14971, and it is not recommended for production use.
Release tags are immutable. v0.1.2 points at be930c3 and will not be moved. Each package has a matching SHA-256 checksum file. The packages were built by the Release workflow run for this tag.
SpecLab v0.1.1
SpecLab v0.1.1
This release fixes the build and makes SpecLab safe to use as a dependency. The test API is unchanged. Consumers such as MduX no longer need to patch SpecLab to use CMake 4.3.
Highlights
import stdworks on CMake 4.0 to 4.4. Each CMake series has its own experimental gate, and newer series are refused until someone qualifies them.- Clang is supported with libc++, through
cmake/toolchains/linux-clang21-libcxx.cmake. CI now builds with Clang 21. - SpecLab's own build settings no longer reach the projects that use it: warnings,
-Werror,/permissive-,NOMINMAX, definitions and cache entries. Sanitizer and coverage link flags are still exported, including in the installed package. - SpecLab's
cmake/helpers are now included by path. Before, a consumer's module with the same name could be loaded in their place. - Definitions renamed from
MDUX_*toSPECLAB_*.WARNINGS_AS_ERRORSis renamed toSPECLAB_WARNINGS_AS_ERRORS, and is on only when SpecLab is the top-level project. - The
ASSERT_*/FAILmacros were removed. They were never reachable throughimport speclab;.
The full list is in CHANGELOG.md.
Requirements
- CMake 4.0–4.4
- GCC 16.1+ (GCC 16.2.0 is not usable, see #17), MSVC 17.10+, or Clang 20+ with libc++
- C++23 with
import stdsupport
Release tags are immutable. v0.1.1 points at 4f58240 and will not be moved.
Each platform archive includes a matching SHA-256 checksum file. The packages were built by the Release workflow run for this tag.
SpecLab v0.1.0
SpecLab v0.1.0
Initial release of the C++23 modules-based testing framework for medical-device software.
Highlights
- BDD-style test cases and suites
- Medical test cases and compliance validation
- Requirements registration, test linking, risk scoring, and traceability exports
- Console reporting and parallel test execution
- Pulse oximeter and basic examples
- GCC 16.1.0 and MSVC 17.10+ validated release packages
Requirements
- CMake 4.0+
- GCC 16.1+, or MSVC 17.10+
- C++23 with
import stdsupport
Each platform archive includes a matching SHA-256 checksum file.