Skip to content

Commit

Permalink
📚 [README]
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-jusiak committed Aug 2, 2024
1 parent 17a7482 commit cd42291
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ut
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// -->
[![Boost Licence](http://img.shields.io/badge/license-boost-blue.svg)](http://www.boost.org/LICENSE_1_0.txt)
[![Version](https://badge.fury.io/gh/qlibs%2Fut.svg)](https://github.com/qlibs/ut/releases)
[![build](https://img.shields.io/badge/build-blue.svg)](https://godbolt.org/z/afY3dY8bY)
[![Try it online](https://img.shields.io/badge/try%20it-online-blue.svg)](https://godbolt.org/z/9d6PTEfbf)
[![build](https://img.shields.io/badge/build-blue.svg)](https://godbolt.org/z/f3WPzK5xf)
[![Try it online](https://img.shields.io/badge/try%20it-online-blue.svg)](https://godbolt.org/z/MG5cjnsbM)

---------------------------------------

Expand Down Expand Up @@ -39,13 +39,13 @@

### Requirements

- C++20 ([gcc-12+, clang-16+](https://godbolt.org/z/ceK6qsx68))
- C++20 ([gcc-12+, clang-16+](https://en.cppreference.com/w/cpp/compiler_support))

---

### Examples

> Hello world (https://godbolt.org/z/9d6PTEfbf)
> Hello world (https://godbolt.org/z/MG5cjnsbM)

```cpp
#include <ut>
Expand All @@ -69,7 +69,7 @@ $CXX example.cpp -std=c++20 -o example && ./example
PASSED: tests: 1 (1 passed, 0 failed, 1 compile-time), asserts: 3 (3 passed, 0 failed)
```

> Execution model (https://godbolt.org/z/48PGjz3x9)
> Execution model (https://godbolt.org/z/31Gc151Mf)

```cpp
static_assert(("sum"_test = [] { // compile-time only
Expand Down Expand Up @@ -108,7 +108,7 @@ example.cpp:14:FAILED:"sum": 6 == 5
FAILED: tests: 3 (2 passed, 1 failed, 0 compile-time), asserts: 2 (1 passed, 1 failed)
```

> Constant evaluation (https://godbolt.org/z/v1snWP5K3)
> Constant evaluation (https://godbolt.org/z/6E86YdbdT)

```cpp
constexpr auto test() {
Expand All @@ -131,7 +131,7 @@ $CXX example.cpp -std=c++20 -o example && ./example
PASSED: tests: 2 (2 passed, 0 failed, 1 compile-time), asserts: 1 (1 passed, 0 failed)
```

> Suites/Sub-tests (https://godbolt.org/z/Mbzc9s3ad)
> Suites/Sub-tests (https://godbolt.org/z/1oT3Gre93)

```cpp
ut::suite test_suite = [] {
Expand All @@ -156,7 +156,7 @@ $CXX example.cpp -std=c++20 -o example && ./example
PASSED: tests: 2 (2 passed, 0 failed, 1 compile-time), asserts: 4 (4 passed, 0 failed)
```

> Assertions (https://godbolt.org/z/W8qnMsrGo)
> Assertions (https://godbolt.org/z/79M7o355a)

```cpp
int main() {
Expand Down Expand Up @@ -213,7 +213,7 @@ int main() {

---

> Reflection integration (https://godbolt.org/z/5T51odcfP)
> Reflection integration (https://godbolt.org/z/v8GG4hfbW)

```cpp
int main() {
Expand All @@ -234,7 +234,7 @@ $CXX example.cpp -std=c++20 -o example && ./example
PASSED: tests: 1 (1 passed, 0 failed, 1 compile-time), asserts: 3 (3 passed, 0 failed)
```

> Custom configuration (https://godbolt.org/z/3qz5vG6nq)
> Custom configuration (https://godbolt.org/z/6MrEEvqja)

```cpp
struct outputter {
Expand Down Expand Up @@ -285,7 +285,7 @@ time $CXX -x c++ -std=c++20 ut -c -DNTEST # 0.028s
time $CXX -x c++ -std=c++20 ut -c # 0.049s
```

> Benchmark - 100 tests, 1000 asserts (https://godbolt.org/z/xhfc518xx)
> Benchmark - 100 tests, 1000 asserts (https://godbolt.org/z/zs5Ee3E7o)

```cpp
[ut]: time $CXX benchmark.cpp -std=c++20 # 0m0.813s
Expand Down

0 comments on commit cd42291

Please sign in to comment.