code/__DEFINES/unit_tests.dm
PERFORM_ALL_TESTS | Are tests enabled with no focus? Use this when performing test assertions outside of a unit test, since a focused test means that you're trying to run a test quickly. If a parameter is provided, will check if the focus is on that test name. For example, PERFORM_ALL_TESTS(log_mapping) will only run if either no test is focused, or the focus is log_mapping. |
---|---|
TEST_ONLY_ASSERT | ASSERT(), but it only actually does anything during unit tests |
REGISTER_REQUIRED_MAP_ITEM | Used for registering typepaths of item to be tracked as a "required map item" This is used to ensure that that all station maps have certain items mapped in that they should have Or that people aren't mapping in an excess of items that they shouldn't be (For example, all map should only ever have 1 Pun Pun) |
Define Details
PERFORM_ALL_TESTS
Are tests enabled with no focus? Use this when performing test assertions outside of a unit test, since a focused test means that you're trying to run a test quickly. If a parameter is provided, will check if the focus is on that test name. For example, PERFORM_ALL_TESTS(log_mapping) will only run if either no test is focused, or the focus is log_mapping.
REGISTER_REQUIRED_MAP_ITEM
Used for registering typepaths of item to be tracked as a "required map item" This is used to ensure that that all station maps have certain items mapped in that they should have Or that people aren't mapping in an excess of items that they shouldn't be (For example, all map should only ever have 1 Pun Pun)
Min is inclusive, Max is inclusive (so 1, 1 means min of 1, max of 1, or only 1 allowed)
This should only be used in Initialize(). And don't forget to update the unit test with the type itself!
TEST_ONLY_ASSERT
ASSERT(), but it only actually does anything during unit tests