exa is a short name for extended assert.
It is using the {fmt} library for formatting output messages.
It actually should work on any OS, that supports the C++14 standard library.
It is tested to work on:
- Linux (without exceptions and without RTTI)
- C++14
- {fmt} library
Currently there is DEBUG, WARNING, DEFAULT, ERROR and FATAL.
DEBUG will only output something, if exa was compiled with NDEBUG defined.
DEBUG and WARNING should run into a breakpoint, while DEFAULT, ERROR and
FATAL are going to abort the program.
At the moment there is then no other difference with the levels, only the output
message, which is written to std::cerr, differs based on the level.
Clone the repository and run git submodule update --init --recursive to get
the dependencies.
Add it as a submodule itself, initialize it recursively and add it to your
CMakeLists.txt with add_subdirectory(exa) + adding the fmtlib and exa header
to your include directories with the variable ${EXA_INCLUDE_DIRS}.
Add libs/fmt files, include/exa/exa.h and src/exa/exa.cpp to your files to
compile.
You can use it for example like:
#include "exa/exa.h"
// some code would surround the following lines ;)
// so this example code is not directly compile-able
EXA_DEBUG(2 == myVar, "myVar should be 2 and not {}", myVar);
EXA_WARNING(a < b);
EXA(1 == 0, "There {} something wrong.", "went");
EXA_ERROR(!myVector.empty(), "the vector is empty");
EXA_FATAL(a / 0, "really bad zero-devision");Tested on linux:
git clone https://github.com/progsource/exa.git
cd exa
git submodule update --init --recursive
mkdir tmp
cd tmp
cmake ..
make
make test # or run the tests directly with: ../build/ExaTestsIf you want to see the output of the asserts during the test runs, you need to
set EXA_DEBUG_TESTS in the CMakeLists.txt to true, so it will still write
everything to cerr.
set(EXA_DEBUG_TESTS true)There are different possibilities:
- Create a GitHub issue
- Create a pull request with an own branch (don't forget to put yourself in the AUTHORS file)
in no particular order