From 225befb22bec09d5e3d67acefcf3827c90af10a7 Mon Sep 17 00:00:00 2001
From: Robert Bendun
Date: Sun, 25 Sep 2022 11:59:50 +0200
Subject: [PATCH] Removed unused files
---
examples/.tests_cache/arithmetic.mq.json | 6 -
examples/.tests_cache/arrays.mq.json | 6 -
.../assigments-state-management.mq.json | 6 -
examples/.tests_cache/church.mq.json | 6 -
examples/.tests_cache/factorial.mq.json | 6 -
examples/.tests_cache/fib.mq.json | 6 -
examples/.tests_cache/permutations.mq.json | 6 -
examples/.tests_cache/variables.mq.json | 6 -
lib/ut/LICENSE.md | 23 -
lib/ut/README.md | 2027 --------------
lib/ut/boost/ut.hpp | 2391 -----------------
11 files changed, 4489 deletions(-)
delete mode 100644 examples/.tests_cache/arithmetic.mq.json
delete mode 100644 examples/.tests_cache/arrays.mq.json
delete mode 100644 examples/.tests_cache/assigments-state-management.mq.json
delete mode 100644 examples/.tests_cache/church.mq.json
delete mode 100644 examples/.tests_cache/factorial.mq.json
delete mode 100644 examples/.tests_cache/fib.mq.json
delete mode 100644 examples/.tests_cache/permutations.mq.json
delete mode 100644 examples/.tests_cache/variables.mq.json
delete mode 100644 lib/ut/LICENSE.md
delete mode 100644 lib/ut/README.md
delete mode 100644 lib/ut/boost/ut.hpp
diff --git a/examples/.tests_cache/arithmetic.mq.json b/examples/.tests_cache/arithmetic.mq.json
deleted file mode 100644
index 7f64229..0000000
--- a/examples/.tests_cache/arithmetic.mq.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "returncode": 0,
- "stdout": "4\n30\n42\n",
- "stderr": "",
- "flags": []
-}
\ No newline at end of file
diff --git a/examples/.tests_cache/arrays.mq.json b/examples/.tests_cache/arrays.mq.json
deleted file mode 100644
index 15c656b..0000000
--- a/examples/.tests_cache/arrays.mq.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "returncode": 0,
- "stdout": "1\n2\n3\n4\n5\n",
- "stderr": "",
- "flags": []
-}
\ No newline at end of file
diff --git a/examples/.tests_cache/assigments-state-management.mq.json b/examples/.tests_cache/assigments-state-management.mq.json
deleted file mode 100644
index 0ec0fa6..0000000
--- a/examples/.tests_cache/assigments-state-management.mq.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "returncode": 0,
- "stdout": "10\n20\n30\n20\n20\n20\n[1; 2; 3]\n[1; 10; 3]\n[1; 3; 3]\n",
- "stderr": "",
- "flags": []
-}
\ No newline at end of file
diff --git a/examples/.tests_cache/church.mq.json b/examples/.tests_cache/church.mq.json
deleted file mode 100644
index ec96bbb..0000000
--- a/examples/.tests_cache/church.mq.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "returncode": 0,
- "stdout": "100\n200\n120\n",
- "stderr": "",
- "flags": []
-}
\ No newline at end of file
diff --git a/examples/.tests_cache/factorial.mq.json b/examples/.tests_cache/factorial.mq.json
deleted file mode 100644
index 05a9aac..0000000
--- a/examples/.tests_cache/factorial.mq.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "returncode": 0,
- "stdout": "1\n1\n2\n6\n24\n120\n720\n5040\n40320\n362880\n1\n1\n2\n6\n24\n120\n720\n5040\n40320\n362880\n1\n1\n2\n6\n24\n120\n720\n5040\n40320\n362880\n",
- "stderr": "",
- "flags": []
-}
\ No newline at end of file
diff --git a/examples/.tests_cache/fib.mq.json b/examples/.tests_cache/fib.mq.json
deleted file mode 100644
index f5facfa..0000000
--- a/examples/.tests_cache/fib.mq.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "returncode": 0,
- "stdout": "",
- "stderr": "",
- "flags": []
-}
\ No newline at end of file
diff --git a/examples/.tests_cache/permutations.mq.json b/examples/.tests_cache/permutations.mq.json
deleted file mode 100644
index a1dc3cf..0000000
--- a/examples/.tests_cache/permutations.mq.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "returncode": 0,
- "stdout": "[1; 2; 3; 4; 5]\n[1; 2; 3; 5; 4]\n[1; 2; 4; 3; 5]\n[1; 2; 4; 5; 3]\n[1; 2; 5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index 8725a7b..0000000
--- a/examples/.tests_cache/variables.mq.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "returncode": 0,
- "stdout": "11\n",
- "stderr": "",
- "flags": []
-}
\ No newline at end of file
diff --git a/lib/ut/LICENSE.md b/lib/ut/LICENSE.md
deleted file mode 100644
index 36b7cd9..0000000
--- a/lib/ut/LICENSE.md
+++ /dev/null
@@ -1,23 +0,0 @@
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/lib/ut/README.md b/lib/ut/README.md
deleted file mode 100644
index aab2fac..0000000
--- a/lib/ut/README.md
+++ /dev/null
@@ -1,2027 +0,0 @@
-![Version](https://badge.fury.io/gh/boost-ext%2Fut.svg)
-![Linux](https://github.com/boost-ext/ut/actions/workflows/linux.yml/badge.svg)
-![MacOs](https://github.com/boost-ext/ut/actions/workflows/macos.yml/badge.svg)
-![Windows](https://github.com/boost-ext/ut/actions/workflows/windows.yml/badge.svg)
-![Coveralls](https://codecov.io/gh/boost-ext/ut/branch/master/graph/badge.svg)
-![Try it online](https://img.shields.io/badge/try%20it-online-blue.svg)
-![AUR Badge](https://img.shields.io/aur/version/ut)
-
-> "If you liked it then you `"should have put a"_test` on it", Beyonce rule
-
-# UT / Ξt
-
-| [Motivation](#motivation) | [Quick Start](#quick-start) | [Overview](#overview) | [Tutorial](#tutorial) | [Examples](#examples) | [User Guide](#user-guide) | [FAQ](#faq) | [Benchmarks](#benchmarks) |
-
-C++ single header/single module, macro-free Ξ(micro)/Unit Testing Framework
-
-
-
-
-
-
-
-Motivation
-
-
-Testing is a very important part of the Software Development, however, C++ doesn't provide any good testing facilities out of the box,
-which often leads into a poor testing experience for develops and/or lack of tests/coverage in general.
-
-> One should treat testing code as production code!
-
-Additionally, well established testing practises such as [Test Driven Development (TDD)](https://en.wikipedia.org/wiki/Test-driven_development)/[Behaviour Driven Development (BDD)](https://en.wikipedia.org/wiki/Behavior-driven_development) are often not followed due to the same reasons.
-
-The following snippet is a common example of testing with projects in C++.
-
-```cpp
-int main() {
- // should sum numbers
- {
- assert(3 == sum(1, 2));
- }
-}
-```
-
-There are quite a few problems with the approach above
-
-* No names for tests (Hard to follow intentions by further readers)
-* No automatic registration of tests (No way to run specific tests)
-* Hard to debug (Assertions don't provide any information why it failed)
-* Hard to scale (No easy path forward for parameterized tests, multiple suites, parallel execution, etc...)
-* Hard to integrate (No easy way to have a custom output such as XML for CI integration)
-* Easy to make mistakes (With implicit casting, floating point comparison, pointer comparison for strings, etc...)
-* Hard to follow good practises such as `TDD/BDD` (Lack of support for sections and declarative expressions)
-* ...
-
-`UT` is trying to address these issues by simplifying testing experience with a few simple steps:
-
-* Just get a single [header/module](https://github.com/boost-ext/ut/blob/master/include/boost/ut.hpp)
-* Integrate it into your project
-* Learn a few simple concepts ([expect, test, suite](#api))
-
-And you good to go!
-
-Okay, great, but why I would use `UT` over other/similar testing frameworks already available in C++?
-
-* [Boost.Test](https://github.com/boostorg/test)
-* [GoogleTest](https://github.com/google/googletest)
-* [Catch](https://github.com/catchorg/Catch2)
-* [...](https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C++)
-
-Great question! There are a few unique features which makes `UT` worth trying
-
-* Firstly, it supports all the basic Unit Testing Framework features (automatic registration of tests, assertions, suites, etc...)
-* It's easy to integrate (it's just one [header/module](https://github.com/boost-ext/ut/blob/master/include/boost/ut.hpp))
-* It's macro free which makes testing experience that much nicer (it uses modern C++ features instead, macros are opt-in rather than being compulsory - [Can I still use macros?](#macros))
-* It's flexible (all parts of the framework such as: [runner, reporter, printer](#examples) can be customized, basically most other Unit Testing Frameworks can be implemented on top of UT primitives)
-* It has smaller learning curve (just a few simple concepts ([expect, test, suite](#api)))
-* It leverages C++ features to support more complex testing ([parameterized](#examples))
-* It's faster to compile and execute than similar frameworks which makes it suitable for bigger projects without additional hassle ([Benchmarks](#benchmarks))
-* It supports [TDD/BDD](#examples) workflows
-* It supports [Gherkin](#examples) specification
-* It supports [Spec](#examples)
-* ...
-
-Sounds intriguing/interesting? Learn more at
-
-* [Tutorial](#tutorial)
-* [Examples](#examples)
-* [User-Guide](#user-guide)
-
-
-
-
-
-Quick Start
-
-
-> https://bit.ly/ut-quick-start (slides)
-
-
-
-
-
-Overview
-
-
-* No dependencies ([C++20](#cpp-20), Tested Compilers: GCC-9+, Clang-9.0+, Apple Clang-11.0.0+, MSVC-2019+*, Clang-cl-9.0+
-* Single header/module ([boost/ut.hpp](https://github.com/boost-ext/ut/blob/master/include/boost/ut.hpp))
-* Macro-free ([How does it work?](#how-it-works))
-* Easy to use ([Minimal API](#api) - `test, suite, operators, literals, [expect]`)
-* Fast to compile/execute ([Benchmarks](#benchmarks))
-* Features ([Assertions](https://github.com/boost-ext/ut/blob/master/example/expect.cpp), [Suites](https://github.com/boost-ext/ut/blob/master/example/suite.cpp), [Tests](https://github.com/boost-ext/ut/blob/master/example/test.cpp), [Sections](https://github.com/boost-ext/ut/blob/master/example/section.cpp), [Parameterized](https://github.com/boost-ext/ut/blob/master/example/parameterized.cpp), [BDD](https://github.com/boost-ext/ut/blob/master/example/BDD.cpp), [Gherkin](https://github.com/boost-ext/ut/blob/master/example/gherkin.cpp), [Spec](https://github.com/boost-ext/ut/blob/master/example/spec.cpp), [Matchers](https://github.com/boost-ext/ut/blob/master/example/matcher.cpp), [Logging](https://github.com/boost-ext/ut/blob/master/example/log.cpp), [Runners](https://github.com/boost-ext/ut/blob/master/example/cfg/runner.cpp), [Reporters](https://github.com/boost-ext/ut/blob/master/example/cfg/reporter.cpp), [...](https://github.com/boost-ext/ut/blob/master/example))
-* Integrations ([ApprovalTests.cpp](https://github.com/approvals/ApprovalTests.cpp/releases/tag/v.7.0.0))
-
-
-
-
-
-Tutorial
-
-
- Step 0: Get it...
-
-
-> Get the latest latest header/module from [here!](https://github.com/boost-ext/ut/blob/master/include/boost/ut.hpp)
-
-> Include/Import
-
-```cpp
-// #include // single header
-// import boost.ut; // single module (C++20)
-
-int main() { }
-```
-
-> Compile & Run
-
-```
-$CXX main.cpp && ./a.out
-```
-
-```
-All tests passed (0 assert in 0 test)
-```
-
-> [Optional] Install it
-
-```
-cmake -Bbuild -H.
-cd build && make # run tests
-cd build && make install # install
-```
-
-> [Optional] CMake integration
-
-This project provides a CMake config and target.
-Just load `ut` with `find_package` to import the `Boost::ut` target.
-Linking against this target will add the necessary include directory for the single header file.
-This is demonstrated in the following example.
-
-```cmake
-find_package(ut REQUIRED)
-add_library(my_test my_test.cpp)
-target_link_libraries(my_test PRIVATE Boost::ut)
-```
-
-> [Optional] [Conan](https://conan.io) integration
-
-The [boost-ext-ut](https://conan.io/center/boost-ext-ut) package is available from [Conan Center](https://conan.io/center/).
-Just include it in your project's Conanfile with `boost-ext-ut/1.1.9`.
-
-
-
-
- Step 1: Expect it...
-
-
-> Let's write our first assertion, shall we?
-
-```cpp
-int main() {
- boost::ut::expect(true);
-}
-```
-
-```
-All tests passed (1 asserts in 0 test)
-```
-
-> https://godbolt.org/z/vfx-eB
-
-
-> Okay, let's make it fail now?
-
-```cpp
-int main() {
- boost::ut::expect(1 == 2);
-}
-```
-
-```
-main.cpp:4:FAILED [false]
-===============================================================================
-tests: 0 | 0 failed
-asserts: 1 | 0 passed | 1 failed
-```
-
-> https://godbolt.org/z/7qTePx
-
-> Notice that expression `1 == 2` hasn't been printed. Instead we got `false`?
-
-> Let's print it then?
-
-```cpp
-int main() {
- using namespace boost::ut;
- expect(1_i == 2);
-}
-```
-
-```
-main.cpp:4:FAILED [1 == 2]
-===============================================================================
-tests: 0 | 0 failed
-asserts: 1 | 0 passed | 1 failed
-```
-
-> https://godbolt.org/z/7MXVzu
-
-> Okay, now we have it! `1 == 2` has been printed as expected.
-> Notice the User Defined Literal (UDL) `1_i` was used.
-> `_i` is a compile-time constant integer value
-
-* It allows to override comparison operators ð
-* It disallow comparison of different types ð
-
-See the [User-guide](#user-guide) for more details.
-
-> Alternatively, a `terse` notation (no expect required) can be used.
-
-```cpp
-int main() {
- using namespace boost::ut::literals;
- using namespace boost::ut::operators::terse;
-
- 1_i == 2; // terse notation
-}
-```
-
-```
-main.cpp:7:FAILED [1 == 2]
-===============================================================================
-tests: 0 | 0 failed
-asserts: 1 | 0 passed | 1 failed
-```
-
-> https://godbolt.org/z/s77GSm
-
-> Other expression syntaxes are also available.
-
-```cpp
-expect(1_i == 2); // UDL syntax
-expect(1 == 2_i); // UDL syntax
-expect(that % 1 == 2); // Matcher syntax
-expect(eq(1, 2)); // eq/neq/gt/ge/lt/le
-```
-
-```
-main.cpp:6:FAILED [1 == 2]
-main.cpp:7:FAILED [1 == 2]
-main.cpp:8:FAILED [1 == 2]
-main.cpp:9:FAILED [1 == 2]
-===============================================================================
-tests: 0 | 0 failed
-asserts: 4 | 0 passed | 4 failed
-```
-
-> https://godbolt.org/z/QbgGtc
-
-> Okay, but what about the case if my assertion is fatal.
-> Meaning that the program will crash unless the processing will be terminated.
-> Nothing easier, let's just add `>> fatal` after the expected expression to make it fatal.
-
-```cpp
-expect((1 == 2_i) >> fatal); // fatal assertion
-expect(1_i == 2); // not executed
-```
-
-```
-main.cpp:6:FAILED [1 == 2]
-===============================================================================
-tests: 1 | 1 failed
-asserts: 2 | 0 passed | 2 failed
-```
-
-> https://godbolt.org/z/WMe8Y1
-
-> But my expression is more complex than just simple comparisons.
-> Not a problem, logic operators are also supported in the `expect` ð.
-
-```cpp
-expect(42l == 42_l and 1 == 2_i); // compound expression
-```
-
-```
-main.cpp:5:FAILED [(42 == 42 and 1 == 2)]
-===============================================================================
-tests: 0 | 0 failed
-asserts: 1 | 0 passed | 1 failed
-```
-
-> https://godbolt.org/z/aEhX4t
-
-> Can I add a custom message though?
-> Sure, `expect` calls are streamable!
-
-```cpp
-int main() {
- expect(42l == 42_l and 1 == 2_i) << "additional info";
-}
-```
-
-```
-main.cpp:5:FAILED [(42 == 42 and 1 == 2)] additional info
-===============================================================================
-tests: 0 | 0 failed
-asserts: 1 | 0 passed | 1 failed
-```
-
-> https://godbolt.org/z/v2PDuU
-
-
-
-
- Step 2: Group it...
-
-
-> Assertions are great, but how to combine them into more cohesive units?
-> `Test cases` are the way to go! They allow to group expectations for the same functionality into coherent units.
-
-```cpp
-"hello world"_test = [] { };
-```
-
-> Alternatively `test("hello world") = [] {}` can be used.
-
-```
-All tests passed (0 asserts in 1 tests)
-```
-
-> https://godbolt.org/z/Bh-EmY
-
-
-> Notice `1 tests` but `0 asserts`.
-
-> Let's make our first end-2-end test case, shall we?
-
-```cpp
-int main() {
- "hello world"_test = [] {
- int i = 43;
- expect(42_i == i);
- };
-}
-```
-
-```
-Running "hello world"...
- main.cpp:8:FAILED [42 == 43]
-FAILED
-===============================================================================
-tests: 1 | 1 failed
-asserts: 1 | 0 passed | 1 failed
-```
-
-> https://godbolt.org/z/Y43mXz
-
-> ð We are done here!
-
-> I'd like to nest my tests, though and share setup/tear-down.
-> With lambdas used to represents `tests/sections` we can easily achieve that.
-> Let's just take a look at the following example.
-
-```cpp
-int main() {
- "[vector]"_test = [] {
- std::vector v(5);
-
- expect((5_ul == std::size(v)) >> fatal);
-
- should("resize bigger") = [v] { // or "resize bigger"_test
- mut(v).resize(10);
- expect(10_ul == std::size(v));
- };
-
- expect((5_ul == std::size(v)) >> fatal);
-
- should("resize smaller") = [=]() mutable { // or "resize smaller"_test
- v.resize(0);
- expect(0_ul == std::size(v));
- };
- }
-}
-```
-
-```
-All tests passed (4 asserts in 1 tests)
-```
-
-> https://godbolt.org/z/XWAdYt
-
-> Nice! That was easy, but I'm a believer into Behaviour Driven Development (`BDD`).
-> Is there a support for that?
-> Yes! Same example as above just with the `BDD` syntax.
-
-```cpp
-int main() {
- "vector"_test = [] {
- given("I have a vector") = [] {
- std::vector v(5);
- expect((5_ul == std::size(v)) >> fatal);
-
- when("I resize bigger") = [=] {
- mut(v).resize(10);
-
- then("The size should increase") = [=] {
- expect(10_ul == std::size(v));
- };
- };
- };
- };
-}
-```
-
-```
-All tests passed (2 asserts in 1 tests)
-```
-
-> https://godbolt.org/z/dnvxsE
-
-> On top of that, `feature/scenario` aliases can be leveraged.
-
-```cpp
-int main() {
- feature("vector") = [] {
- scenario("size") = [] {
- given("I have a vector") = [] {
- std::vector v(5);
- expect((5_ul == std::size(v)) >> fatal);
-
- when("I resize bigger") = [=] {
- mut(v).resize(10);
-
- then("The size should increase") = [=] {
- expect(10_ul == std::size(v));
- };
- };
- };
- };
- };
-}
-```
-
-```
-All tests passed (2 asserts in 1 tests)
-```
-
-> https://godbolt.org/z/T4cWss
-
-> Can I use `Gherkin`?
-> Yeah, let's rewrite the example using `Gherkin` specification
-
-```cpp
-int main() {
- bdd::gherkin::steps steps = [](auto& steps) {
- steps.feature("Vector") = [&] {
- steps.scenario("*") = [&] {
- steps.given("I have a vector") = [&] {
- std::vector v(5);
- expect((5_ul == std::size(v)) >> fatal);
-
- steps.when("I resize bigger") = [&] {
- v.resize(10);
- };
-
- steps.then("The size should increase") = [&] {
- expect(10_ul == std::size(v));
- };
- };
- };
- };
- };
-
- "Vector"_test = steps |
- R"(
- Feature: Vector
- Scenario: Resize
- Given I have a vector
- When I resize bigger
- Then The size should increase
- )";
-}
-```
-
-```
-All tests passed (2 asserts in 1 tests)
-```
-
-> https://godbolt.org/z/jb1d8P
-
-> Nice, is `Spec` notation supported as well?
-
-```cpp
-int main() {
- describe("vector") = [] {
- std::vector v(5);
- expect((5_ul == std::size(v)) >> fatal);
-
- it("should resize bigger") = [v] {
- mut(v).resize(10);
- expect(10_ul == std::size(v));
- };
- };
-}
-```
-
-```
-All tests passed (2 asserts in 1 tests)
-```
-
-> https://godbolt.org/z/6jKKzT
-
-> That's great, but how can call the same tests with different arguments/types to be DRY (Don't Repeat Yourself)?
-> Parameterized tests to the rescue!
-
-```cpp
-int main() {
- for (auto i : std::vector{1, 2, 3}) {
- test("parameterized " + std::to_string(i)) = [i] { // 3 tests
- expect(that % i > 0); // 3 asserts
- };
- }
-}
-```
-
-```
-All tests passed (3 asserts in 3 tests)
-```
-
-> https://godbolt.org/z/Utnd6X
-
-> That's it ðŪ!
-> Alternatively, a convenient test syntax is also provided ð
-
-```cpp
-int main() {
- "args"_test = [](const auto& arg) {
- expect(arg > 0_i) << "all values greater than 0";
- } | std::vector{1, 2, 3};
-}
-```
-
-```
-All tests passed (3 asserts in 3 tests)
-```
-
-> https://godbolt.org/z/6FHtpq
-
-> Check [Examples](#examples) for further reading.
-
-
-
-
- Step 3: Scale it...
-
-
-> Okay, but my project is more complex than that. How can I scale?
-> `Test suites` will make that possible. By using `suite` in translation units
-> `tests` defined inside will be automatically registered ð
-
-```cpp
-suite errors = [] {
- "exception"_test = [] {
- expect(throws([] { throw 0; })) << "throws any exception";
- };
-
- "failure"_test = [] {
- expect(aborts([] { assert(false); }));
- };
-};
-
-int main() { }
-```
-
-```
-All tests passed (2 asserts in 2 tests)
-```
-
-> https://godbolt.org/z/_ccGwZ
-
----
-
-> What's next?
-> * [Examples](#examples)
-> * [User-Guide](#user-guide)
-
-
-
-> Personally, I believe that C++ standard could benefit from common testing primitives (`expect`, `""_test`) because
-
-* It lowers the entry-level to the language (no need for third-party libraries)
-* It improves the education aspect (one standard way of doing it)
-* It makes the language more coherent/stable (consistent design with other features, stable API)
-* It makes the testing a first class citizen (shows that the community cares about this aspect of the language)
-* It allows to publish tests for the Standard Library (STL) in the standard way (coherency, easier to extend)
-* It allows to act as additional documentation as a way to verify whether a particular implementation is conforming (quality, self-verification)
-* It helps with establishing standard vocabulary for testing (common across STL and other projects)
-
-
-
-
-
- Can I still use macros?
-
-
-> Sure, although please notice that there are negatives of using macros such as
-
-* Error messages might be not clear and/or point to the wrong line
-* Global scope will be polluted
-* Type safety will be ignored
-
-```cpp
-#define EXPECT(...) ::boost::ut::expect(::boost::ut::that % __VA_ARGS__)
-#define SUITE ::boost::ut::suite _ = []
-#define TEST(name) ::boost::ut::detail::test{"test", name} = [=]() mutable
-
-SUITE {
- TEST("suite") {
- EXPECT(42 == 42);
- };
-};
-
-int main() {
- TEST("macro") {
- EXPECT(1 != 2);
- };
-
- TEST("vector") {
- std::vector v(5);
-
- EXPECT((5u == std::size(v)) >> fatal) << "fatal";
-
- TEST("resize bigger") {
- v.resize(10);
- EXPECT(10u == std::size(v));
- };
- };
-}
-```
-
-```
-All tests passed (4 asserts in 3 tests)
-```
-
-> https://godbolt.org/z/WcEKTr
-
-
-
-
- What about Mocks/Stubs/Fakes?
-
-
-> Consider using one of the following frameworks
-
-* https://github.com/cpp-testing/GUnit/blob/master/docs/GMock.md
-* https://github.com/eranpeer/FakeIt
-* https://github.com/dascandy/hippomocks
-
-
-
-
- What about Microbenchmarking?
-
-
-> [Example benchmark](example/benchmark.cpp)
-
-> Consider using one of the following frameworks
-
-* https://github.com/google/benchmark
-* https://github.com/DigitalInBlue/Celero
-* https://github.com/libnonius/nonius
-* https://github.com/martinus/nanobench
-
-
-
-
- Related materials/talks?
-
-
-* [[Boost].UT - Unit Testing Framework - Kris Jusiak](https://boost-ext.github.io/ut/denver-cpp-2019)
-* [Future of Testing with C++20 - Kris Jusiak](https://boost-ext.github.io/ut/meeting-cpp-2020)
-* [Macro-Free Testing with C++20 - Kris Jusiak](https://www.youtube.com/watch?v=irdgFyxOs_Y)
-* ["If you liked it then you `"should have put a"_test` on it", Beyonce rule - Kris Jusiak](https://www.youtube.com/watch?v=yCI8MjvOMeE)
-* [Principles of Unit Testing With C++ - Dave Steffen and Kris Jusiak](https://www.youtube.com/watch?v=oOcuJdJJ33g)
-* [Empirical Unit Testing - Dave Steffen](https://www.twitch.tv/videos/686512433)
-
-