Developing new test cases
- If you adding test case in existing ones just make sure you use assume for the right gdb
If some functionality only available (or not) in certain gdb's you can use junit4 assume statement.
Parent class provides that following functions for convenience
assumeGdbVersionAtLeast("7.4") - test will only be run for gdb 7.4 or higher and ignored for the rest
assumeGdbVersionLowerThen("6.9") - test will be run only for gdb which is stricly lower than 6.9 (which is 6.8 and lower)
assumeGdbVersionNot("6.8") - skip the test for a specific gdb.
You can also combine them if need be
You can also assume for remote if you test only remote (or visa versa), i.e
Assume.assumeTrue("Skipping non-remote", remote);
If you need to change some setup function based on version there are some version comparision utils you can use. I only found 2 method then needed if version
for setup
- If you adding new test case make sure it extends BaseParametrizedTestCase and use Parametrized running (see others as example)
- And new test case into SuiteGdb (remote or local)
Implementation details:
if you looking for implementation details interesting classes are BaseParametrizedTestCase which defines getVersion which is what it injected as parameters,
AllSuite - how you can override parameters from a class (cannot do it if using Suite annotations)
TODO:
- I should put this test on the wiki somewhere
- Lots of tests are using sleeps which is bad for performance and random failures
- Lots of tests use similar harness which can be implemented as junit4 Rules
- We can make a smart default run which instead of running specific version of gdb will run all versions but only tests which won't be run in any higher version, i.e. all tests will be run once if most approprate gdb version
P.S. Thanks Marc for putting up my re-formatting (although it was not reformatted but white space removing tool but it did something awful in some cases).