nosh is a no shit C++ test framework
- What you see is what you get. No magic behind your back.
- No shoutcased macros
- A test is a simple C++ class. An assertion is a simple method of the Test class with defined syntax.
- Easy to understand and get started.
- Develop parameter based tests. Easily generate parameters for tests using Generators.
- Download
nosh.hpp
or clone this repository - Make sure
nosh.hpp
is in one of your project's include paths - Follow the tutorial section to add test cases to your project using nosh
class SimpleTest: public Test {
public:
SimpleTest() {
//TODO Construction goes here
}
virtual ~SimpleTest() {
//TODO Destruction goes here
}
virtual void run() {
//TODO Test logic goes here
}
};
int main(void) {
execTest(SimpleTest());
}
Fatal assertion | Nonfatal assertion | Verifies |
---|---|---|
assertTrue( condition) ; |
expectTrue( condition) ; |
condition is true |
assertFalse( condition) ; |
expectFalse( condition) ; |
condition is false |
Fatal assertion | Nonfatal assertion | Verifies |
---|---|---|
assertEQ( val1, val2); |
expectEQ( val1, val2); |
val1 == val2 |
assertNE( val1, val2); |
expectNE( val1, val2); |
val1 != val2 |
assertLT( val1, val2); |
expectLT( val1, val2); |
val1 < val2 |
assertLE( val1, val2); |
expectLE( val1, val2); |
val1 <= val2 |
assertGT( val1, val2); |
expectGT( val1, val2); |
val1 > val2 |
assertGE( val1, val2); |
expectGE( val1, val2); |
val1 >= val2 |
TBD
TBD
TBD
TBD
- Test fixtures
- Basic and binary assertions
- Tests with parameters
- Parameter generators
- Print information about test case before run. Print parameters in case parameters are involved
- Versbose/No verbose command line flag
- Filter tests from command line
- Filter tests programatically
- Export test results in JSON, XML