Features of UquoniTest
Find out what happens in your code, faster
Unit testing is supposed to make you code faster. UquoniTest will give you informative feedback that allows you to keep going fast.
- Assertions that can have Rich Booleans for the condition. This means you can write e.g. uqtASSERT(rbEQUAL(a, b)) instead of ASSERT_EQUAL(a, b), except uqtASSERT can be replaced by other assertion macros, and rbEQUAL(a, b) can be replaced by any of the other 80 Rich Booleans, including things like checking if a file exists, or is writable, or if a range is a subset of another range. In case of a failure they provide extra information, e.g. the value of compared variables, or what part of the filepath of a nonexistent file does exist, or what values in a supposed subset are not in the superset. This makes assertions a lot more informative.
- Reporting of assertions in domain code (if ModAssert is used).
- Checking if the value of an expression is not changed by unit tests. If an expression is supposed to remain constant, you can easily test if it really is constant. Just specify this once to have it checked in all tests.
- Orthodoxy testing for easily checking whether copy constructors, assigment operators and comparison operators work well. Knowing that these work as expected is important. With orthodoxy testing you can do this with one short unit test.
- Custom exception catchers, which you specify just once for all unit tests, give extra information if an exception specific to your codebase is thrown unexpectedly. No simple 'an exception was thrown' error messages, you will know what type it is. Predefined for standard and MFC exceptions.
Make code more testable
Some features of your application are hard to test with other unit test frameworks, where UquoniTest happily helps you out.
- Creation of test directories, prefilling them easily with files and subdirectories, which you can reuse, allows you to test code that otherwise would not be possible in unit tests, e.g. code that iterates the files in a directory.
- The Rich Booleans mentioned above also make it possible to check conditions that are otherwise hard to test, e.g. if a container is a subset of another one, making your unit tests a lot shorter.
- Specifying a maximum time for unit tests, and even a minimum time.
- An advanced mock framework that is more flexible than others.
Reuse test code
Reusing test code is important to test faster. And making adjustments in just one place saves you headaches.
- Parameterized and template tests let you reuse unit test code easily. With test suites you can even read data from a file and feed them to parameterized unit tests.
- Abstract unit tests, to easily check whether classes derived from a common base class all satisfy the same requirements. Multiple levels of inheritance with tests on each level, and multiple inheritance are easy to do.
Rely on the safety of UquoniTest
The reliability of UquoniTest that is always there in the background allows you to focus on the important things.
- All testing is thread safe. So if an assertion fails on another thread, it will be reported safely.
- Unit tests are registered automatically, so there is no danger of forgetting to register a unit test. You can't even write a test without registering it. Some other frameworks require you to register every test in a test suite, with some you even need to add code in three different places.
- All macros are prepended with uqt, e.g. uqtTEST and uqtASSERT. This prevents the risk that they conflict with macros or identifiers with the same name in your code or a library that you use, which is not the case with some other unit testing libraries.
A flexible framework to suit your needs
- Different types of test listeners with different granularity let you write your own test reports in addition to the provided ones, or execute some code before and/or after each unit test
- Test wrappers, for all tests or just a test group.
- Include and exclude test objects by name, level and or attribute; also using regular expressions.
Easy to learn
- The basics of UquoniTest are the same as well known open source unit testing frameworks like Unittest++. Therefore it is quite easy to get started for developers who have experience with such frameworks. But the manual explains it well for developers who are new to unit testing.
- The manual is well written. The begin of every chapter explains what the use is of the features explained in that chapter, so you can decide right away if you need the chapter.