Quick little first release with some docs and a design that works. Need to use it in a project for real and improve it based on actual usage.

master
Zed A. Shaw 11 hours ago
parent 7dc4e10573
commit 637dcabd63
  1. 27
      README.md
  2. 4
      src/fuc2.cpp
  3. 13
      tests/sample_failing.cpp

@ -1,3 +1,28 @@
# fuc2 # fuc2
A very simple testing framework that rejects all previous testing designs and aims for plain wording, simple usability, and ease of debugging. You will never ask where a failure was ever again. A very simple testing framework that rejects all previous testing designs and aims for plain wording, simple usability, ease of debugging, __and designed for programmers only__. No weird testing verbiage, dogma, or strange latinized words to sound "sciency." The goal is to make writing tests less high-brow so normal people don't mind writing tests for their code.
Another major goal of the project is to use plain regular old C++ that's very easy to debug. The
logging output clearly shows what tests runs, catches exceptions and reports them, and the API makes
it easy to set breakpoints on test functions. I know, revolutionary.
## Quick Install
Initial quick release. Look at the `meson.build` and the `tests/*` directory for a quicke example.
You buid it like this:
```sh
./scripts/reset_build.sh
make
make test
```
On Windows it's:
```shell
./scripts/reset_build.ps1
make
make test
```
Instructions on how to use it in your own project coming soon.

@ -80,13 +80,13 @@ namespace fuc2 {
} }
if(fail_count > 0) { if(fail_count > 0) {
fmt::println("🚨 FAIL COUNT: {}", fail_count); fmt::println("🚨🚨🚨🚨🚨 FAIL COUNT: {} in {}", fail_count, test_set.location.file_name());
for(auto& msg : errors) { for(auto& msg : errors) {
fmt::println("---------\n{}", msg); fmt::println("---------\n{}", msg);
} }
} else { } else {
fmt::println("👍 ALL PASS"); fmt::println("👍 ALL PASS: {}", test_set.location.file_name());
} }
return fail_count; return fail_count;

@ -25,11 +25,22 @@ namespace sample_failing {
EQUAL(ages.size(), size_t(5), "wrong count"); EQUAL(ages.size(), size_t(5), "wrong count");
} }
void fail_blows_up() {
std::deque<float> ages;
auto runner = [&]() {
fmt::println("this will fail.");
};
BLOWS_UP(runner, "pop_front empty should crash");
}
fuc2::Set TESTS{ fuc2::Set TESTS{
.name="std::deque basic operations", .name="std::deque failing ops",
.options={ .fail_fast=false }, .options={ .fail_fast=false },
.tests={ .tests={
{"fail_pop_back", fail_push_pop_back}, {"fail_pop_back", fail_push_pop_back},
{"fail_blows_up", fail_blows_up},
} }
}; };
} }

Loading…
Cancel
Save