Skip to content

Commit

Permalink
Merge pull request #24198 from SkippyMcSkip/documentation-revisions
Browse files Browse the repository at this point in the history
Document Revision for TESTING.md
  • Loading branch information
Rivet-the-Zombie authored Jul 6, 2018
2 parents bb41bf6 + b33cfe4 commit d5c16a6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions doc/TESTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Tests

There are a number of test cases in `tests/`. The test framework is [Catch](https://github.com/philsquared/Catch). For tutorials, please visit [https://github.com/philsquared/Catch/blob/master/docs/tutorial.md](https://github.com/philsquared/Catch/blob/master/docs/tutorial.md).
There are a number of test cases in [`tests/`](https://github.com/CleverRaven/Cataclysm-DDA/tree/master/tests). The test framework is [Catch](https://github.com/philsquared/Catch). For tutorials, please visit [https://github.com/philsquared/Catch/blob/master/docs/tutorial.md](https://github.com/philsquared/Catch/blob/master/docs/tutorial.md).

## Guidelines
When creating tests, insure that any objects used (directly or indirectly) are fully reset befre testing.
A number of tests have been rendered flaky by either properties of randomly generated objects or by interactions between tests via global objects (mostly the player object).
When creating tests, ensure that all objects used (directly or indirectly) are fully reset before testing. Several tests have been rendered flaky by properties of randomly generated objects or interactions between tests via global objects (often the player object). As a general guideline, test cases should be standalone (one test should not rely on the output of another).

When generating objects with json definitions, use REQUIRE statements to assert the properties of the objects that the test needs.
This protects the test from shifting json definitions, by making it apparent what about the object changed to cause the test to break.
This protects the test from shifting json definitions by making it apparent what about the object changed to cause the test to break.

0 comments on commit d5c16a6

Please sign in to comment.