You've already forked bitshift-validate
102 lines
2.2 KiB
Markdown
102 lines
2.2 KiB
Markdown
Validate
|
|
========
|
|
|
|
BitShift Validate is a minimalist unit-testing library for C++. Its primary
|
|
purpose is to test the various other BitShift projects without making them
|
|
dependent on larger unit-testing libraries.
|
|
|
|
Why BitShift Validate?
|
|
----------------------
|
|
|
|
A small and dependency-free unit-testing library with first-class build2
|
|
support was required for the other BitShift Projects.
|
|
|
|
And a shitload of other reasons, for example, not embracing CMake(Shit) or
|
|
supporting Google world-dominance by using GTest.
|
|
|
|
Requirements
|
|
------------
|
|
|
|
- A modern C++ compiler with C++23 suppport (GCC 14+ or Clang 18+),
|
|
|
|
- [build2][build2]: The build2 build and package management system.
|
|
|
|
Usage
|
|
-----
|
|
|
|
To start using BitShift Validate to test your project, add the following
|
|
`depends` value to your `manifest`, adjusting the version constraint as
|
|
appropriate:
|
|
|
|
```
|
|
depends: bitshift-validate ^<VERSION>
|
|
```
|
|
|
|
Then import the library in your `buildfile`:
|
|
|
|
```
|
|
test_libs =
|
|
import test_libs =+ bitshift-validate%lib{validate}
|
|
|
|
./: exe{my-test}: {hxx ixx txx cxx}{**} $test_libs
|
|
```
|
|
|
|
Importable Targets
|
|
------------------
|
|
|
|
This package provides the following importable targets:
|
|
|
|
```
|
|
lib{validate}
|
|
```
|
|
|
|
### `lib{validate}`
|
|
|
|
Implementation of the test library.
|
|
|
|
Usage Example
|
|
-------------
|
|
|
|
```c++
|
|
#include <bitshift/validate/validate.hxx>
|
|
|
|
BV_TEST(example.test, "an example test")
|
|
{
|
|
int x = 0;
|
|
int y = 1;
|
|
|
|
BV_ASSERT_NOT_EQUAL(x, y);
|
|
}
|
|
|
|
int
|
|
main(int argc, char* argv[])
|
|
{
|
|
return bitshift::validate::main(argc, argv);
|
|
}
|
|
```
|
|
|
|
Documentation
|
|
-------------
|
|
|
|
The latest API reference documentation can be found at:
|
|
https://bitshift.helloryan.se/validate/
|
|
|
|
Bugs
|
|
----
|
|
|
|
There are probably many goblins lurking in the code. If you find one, please
|
|
report it promptly to [ryan@helloryan.se][ryan@helloryan.se]. Please include as
|
|
much information as possible and preferably a link to a reproducible.
|
|
|
|
Contributing
|
|
------------
|
|
|
|
If you want to actively contribute to the project, send an e-mail to
|
|
[ryan@helloryan.se][ryan@helloryan.se], to discuss repository access.
|
|
|
|
Contributions are welcome in many forms, from code contributions to simple
|
|
issue reporting. Don't hesitate to get in touch!
|
|
|
|
[build2]: https://build2.org/
|
|
[ryan@helloryan.se]: mailto:ryan@helloryan.se
|