-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24198 from SkippyMcSkip/documentation-revisions
Document Revision for TESTING.md
- Loading branch information
Showing
1 changed file
with
3 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |