diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-10-21 20:26:16 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-10-21 20:26:16 +0900 |
commit | b822e2e116c38c99fd9f05fbe0f3c0fd20103b29 (patch) | |
tree | b8687558e5352316ba38c17999f683a0b7431be3 /CONTRIBUTING.md | |
parent | 9b588b30505a71da8004965364a42d24f6f2f16d (diff) | |
download | libquotient-b822e2e116c38c99fd9f05fbe0f3c0fd20103b29.tar.gz libquotient-b822e2e116c38c99fd9f05fbe0f3c0fd20103b29.zip |
Quotest: more work on test invocation
Tests should be private slots, not public slots; and they
are invoked through a QueuedConnection so that both sync
and async tests could be processed uniformly with clear code.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88352e04..fd604621 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -249,14 +249,14 @@ be used eventually. The `tests/` directory contains a command-line program, quotest, used for automated functional testing. Any significant addition to the library API should be accompanied by a respective test in quotest. To add a test you should: -- Add a new test to the `TestSuite` class (technically, each test is a public +- Add a new test to the `TestSuite` class (technically, each test is a private slot and there are two macros, `TEST_DECL()` and `TEST_IMPL()`, that conceal - passing the testing context to the test method). + passing the testing handle in `thisTest` variable to the test method). - Add test logic to the slot, using `FINISH_TEST` macro to assert the test outcome and complete the test (`FINISH_TEST` contains `return`). ALL - (even failing) branches should conclude with a `FINISH_TEST` invocation, - unless you intend to have a "DID NOT FINISH" message in the logs - under certain conditions. + (even failing) branches should conclude with a `FINISH_TEST` (or `FAIL_TEST` + that is a shortcut for a failing `FINISH_TEST`) invocation, unless you + intend to have a "DID NOT FINISH" message in the logs in certain conditions. The `TestManager` class sets up some basic test fixture to help you with testing; notably, the tests can rely on having an initialised `Room` object for the test |