CHANGELOG.md
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
Added
core
library
- The
format
namespace:- Lots of functions for formatting anything you can think of: STL containers, plain arrays, C strings, pointers...
- A
format_anything()
function which intelligently selects a formatter based on a compile-time type check
- Lots of new
ASSERT
macros, for parity with theEXPECT
API
testing
library
- Self tests (at least, for the parts that can be isolated and tested!)
Changed
ASSERT
,EXPECT
, andResult
now use theformat_anything()
function to render objects
Deprecated
Removed
ASSERT_NOT_NULL
is gone; useASSERT_NE(thing, nullptr)
Fixed
Security
0.3.0
Released on November 06, 2021.
Added
core
library
- A new namespace called
assert
, containing functions for implementing theASSERT
macro family - In the
assert
namespace:- A pair of new macros called
ASSERT
andASSERT_NOT_NULL
, which terminate the program with a message if the assertion does not pass - A template function called
fail
, which implements the assertion failure mechanism
- A pair of new macros called
- A new namespace called
either
, containing theEither
type for holding one of two types of value - In the
either
namespace:- A tag type called
PreventSelectionForCopyAndMove
used internally - A pair of templates called
LHS
andRHS
which distinguish the alternatives of anEither
- A template called
Either
which can hold one of two values, which can have different types - A pair of functions called
make_lhs()
andmake_rhs()
, which can be used to createLHS
andRHS
instances to pass to anEither
- A tag type called
parsing
library
- In the
bits
namespace:- A new parser called
SizedByteSequence
which extracts a specific number of bytes from the input
- A new parser called
- In the
combinators
namespace:- A new combinator called
Into
, which functions likeAndThen
but dynamically constructs the second parser based on the result of the first parser - Two new errors called
AndThenError
andIntoError
, which serve as error types for theAndThen
andInto
combinators
- A new combinator called
- In the
combinators::operators
namespace:- An overloaded
>>
operator, which buildsInto
instances from a parser and a function
- An overloaded
testing
library
- In the
expect
namespace:- A pair of new macros called
EXPECT_CONTAINER_EQ
andEXPECT_CONTAINER_NE
, which check for (in)equality between two iterables
- A pair of new macros called
- In the
abstract_reporter
namespace:- The
AbstractReporter
class now has default do-nothing implementations for all of its virtual methods - Two new hook methods for
AbstractReporter
:handle_group_start()
andhandle_group_end()
, which get the name of the group
- The
- In the
reporter
namespace:- Forwarding methods for the
handle_group_start()
andhandle_group_end()
hooks
- Forwarding methods for the
- In the
console_reporter
namespace:- An implementation of
handle_group_start
that prints the group name
- An implementation of
Changed
testing
library
- Scenarios and fixtures now both accept a tag argument before the name, which groups the fixtures and scenarios together
- Tags can be filtered on the command line with the
-t
or--tag
option - Fixtures will only be run for the scenarios that have the same tag
BeforeAll
andAfterAll
fixtures will only run if their tag isn't being filtered out
- Tags can be filtered on the command line with the
- Output rendering is much clearer
- A count of total scenarios run is now printed
- Fixtures are now printed at the same level as scenarios instead of inside them
- Fixtures receive a pass/fail note (when they would be printed anyways)
- Added icons for each keyword to make distinguishing them a little clearer
- Removed all white and bright white to make reading output on a white background easier
- "Tags" renamed to "Groups"
- The option in the CLI runner has been changed from
-t/--tag
to-g/--group
- The option in the CLI runner has been changed from
- Groups are now used as "containers" for scenarios
- There are now two loops: one over each group, and another over each scenario within the group
BeforeAll
andAfterAll
fixtures now run only within their group, not at the start or end of the whole suite- The console reporter will show groups as the main heading now, with scenarios and fixtures underneath
unix
library
test_fs
now uses the fixture mechanism to create and delete its file structure
General
- Turned all instances of
std::u8string
,std::u8string_view
,char8_t
, andu8""
literals back into their legacy versions due to bad support - Standardized constructor syntax (
{}
unless()
is semantically required)
parsing
library
- The
bits::ByteSequence
andtext::CharacterSequence
parsers now make a deep copy of their sequences - The
bits::ByteSequence
parser has been renamed tobits::ExactByteSequence
Fixed
- Compilation error on AppleClang:
no viable constructor or deduction guide
incore::assert::fail()
0.2.0
Released on October 02, 2021.
Added
New libraries
vm
library for the virtual machine implementationparsing
library for parser combinators
parsing
library features
bits
namespace containing primitives for parsing binary dataFixedWidthUnsignedIntegerType
concept, which constrains to one of thestd::uintN_t
typesByteSequenceMismatch
basic error typeUnexpectedEndOfInput
basic error typeBitsError
composite error typeBitsState
type specialized for binary dataByteSequence
parser which matches an exact sequence of bytesLittleEndianUnsignedInteger
parser templateBigEndianUnsignedInteger
parser template
combinators
namespace containing types for combining simple parsers into more complex parsersBothMatch
error templateNeitherMatch
error templateOneOfError
composite error typeOneOf
parser combinator, which matches exclusively one or the other of the child parsersAndThen
parser combinator, which matches one parser followed by another parser and returns both resultsoperators
namespace containing tools for building combinator treesoperator^
, which combines two parsers using theOneOf
combinatoroperator&
, which combines two parsers using theAndThen
combinator
result
namespace containing utility types for the outcomes of individual parsersReject
template for holding information about a rejected parseAccept
template for holding information about an accepted parsereject
function for building aReject
wrapped in acore::result::Failure
accept
function for building anAccept
wrapped in acore::result::Success
text
namespace containing primitives for parsing UTF-8 dataCharacterSequenceMismatch
basic error typeTextError
composite error typeTextState
type specialized for UTF-8 dataCharacterSequence
parser which matches an exact sequence of characters
testing
library features
- New namespace:
fixture
for types related to test fixtures - In the
fixture
namespace:FixtureFunction
alias for the type of a fixture functionFixtureVariant
template type which serves as a base class for each kind of fixtureBeforeAll
,AfterAll
,BeforeEach
, andAfterEach
tag types which differentiate each kind of fixture- The
Fixture
type itself, which abstracts over all of these details - In the
FixtureVariant
type:- A constructor accepting a
FixtureFunction
- A getter method called
get_name()
which returns the name of the fixture variant based on which derived class calls it - A method named
execute()
which runs the fixture and returns an outcome, just like a scenario
- A constructor accepting a
- In the
BeforeAll
,AfterAll
,BeforeEach
, andAfterEach
types:- A constant string field containing the name of the variant for reporting purposes
- In the
Fixture
type:- A constructor which accepts a name and a fixture variant
- A template method called
has_variant()
which checks what kind of fixture this is - A method called
get_variant_name()
which forwards toget_name()
on the underlying variant - A getter method called
get_name()
which retrieves the fixture's name - A method called
execute()
which forwards toexecute()
on the underlying variant
- In the
suite
namespace:- Four new macros which define fixtures in the same way as scenarios:
BEFORE_ALL
,AFTER_ALL
,BEFORE_EACH
, andAFTER_EACH
- A new type called
FixtureRegistrar
which is used by the new macros to add fixtures to the suite - In the
FixtureRegistrar
type:- A constructor that forwards to
add_fixture()
on the suite
- A constructor that forwards to
- In the
Suite
singleton:- A method called
add_fixture()
which registers a new fixture in the suite
- A method called
- Four new macros which define fixtures in the same way as scenarios:
- In
reporter::Reporter
,abstract_reporter::AbstractReporter
, andconsole_reporter::ConsoleReporter
:- Two new methods called
handle_fixture_start()
andhandle_fixture_end()
which are called before and after each fixture - Another new method called
set_show_fixtures()
which toggles how much information is reported about fixtures
- Two new methods called
- In the
expect
namespace:- A new template function called
fail_comparison()
, which is exactly likefail()
but formats its output specifically as a comparison failure
- A new template function called
Changed
Build system
- Upgrade the C++ version to C++20
- Renamed the
test
library totesting
to better fit with other library names (specificallyparsing
)
testing
library features
- Print a special message when there are no tests in a test suite
- Tests can now accept a
--show-fixtures
argument on the command line which causes the reporter to print more information about which fixtures run and when - The
SCENARIO
macro andScenarioRegistrar
type have been moved to thesuite
namespace - The console reporter will now display a count of total fixture invocations in the suite summary
- All reporters now require a third argument,
fixture_count
, to thehandle_suite_end()
method - The
EXPECT
family of macros now print much more detailed information when a test fails - In the
expect
namespace:- The
fail
function now takes more arguments and has been made into a template based on the type of value beingEXPECT
ed
- The
Fixed
parsing
library
- Compilation
cast truncates constant value
warning on MSVC
testing
library
- Disallow copying and moving the Suite singleton
- Incorrect include guard symbols
- Compilation warning on AppleClang:
[[nodiscard]]
on a function returningvoid
Build system
- Give a nice message from CMake instead of weird errors when trying to build for non-64-bit systems
0.1.0
Released on September 04, 2021.
Added
New libraries
core
library for fundamental types and functions used by everything elsetest
library for testing infrastructureunix
library for wrapping Unix-like APIswindows
library for wrapping Windows APIs
core
library features
core::constant_error
namespace, containing aConstantError
template for errors with a constant messagecore::error_chain
namespace, containing theErrorChain
class for building complex error typescore::none
namespace, containing theNone
type to use as a placeholdercore::resource_warden
namespace, containing a class template for cleaning up raw resources on scope exitcore::result
namespace, containing facilities for operations that can fail
test
library features
test::abstract_reporter
namespace, containing theAbstractReporter
interfacetest::cli
namespace, containing a functionexecute()
that can be called frommain()
test::console_reporter
namespace, containing a reporter that writes to stdouttest::expect
namespace, containing macros to express test assertionstest::outcome
namespace, containing types representing scenario outcomestest::reporter
namespace, containing factories for specific reporters and also a wrapper typetest::scenario
namespace, containing theScenario
type for representing a single test scenariotest::suite
namespace, containing theSuite
singleton used to hold all of the tests in a suite
unix
library features
unix::errno_error
namespace, containing utilities for working witherrno
unix::fs
namespace, containing wrappers for filesystem APIs on Unix-like systems
windows
library features
windows::fs
namespace, containing wrappers for filesystem APIs on Windowswindows::transcoding
namespace, containing functions for transcoding UTF8 with UTF16 for Windows APIswindows::windows_error
namespace, containing functions and a type for reading and formatting Windows errors
Build system features
AddCrucibleExecutable
module, which provides a wrapper foradd_executable()
AddCrucibleLibrary
module, which provides a wrapper foradd_library()
AddCrucibleTest
module, which provides a wrapper foradd_test()
EnableCompilerWarnings
module, which provides a function that enables common compiler warning flagsEnableRuntimeSanitizers
module, which provides a function that enables ASAN, TSAN, and UBSAN based on options- Write all final build outputs (executables and libraries) to
${PROJECT_BINARY_DIR}/artifacts
- Automatically export all symbols from all libraries when building Windows DLLs
Repository features
- Build dependencies in the README
- Build instructions in the README
- Test instructions in the README
- Attribution in the README