Daedalus Dock - Modules - TypesDefine Details

code/modules/unit_tests/__unit_tests.dm

TEST_FAILFor advanced cases, fail unconditionally but don't return (so a test can return multiple results)
TEST_SKIPMark the test as skipped.
TEST_ASSERTAsserts that a condition is true If the condition is not true, fails the test
TEST_ASSERT_NOTNULLAsserts that a parameter is not null
TEST_ASSERT_NULLAsserts that a parameter is null
TEST_ASSERT_EQUALAsserts that the two parameters passed are equal, fails otherwise Optionally allows an additional message in the case of a failure
TEST_ASSERT_NOTEQUALAsserts that the two parameters passed are not equal, fails otherwise Optionally allows an additional message in the case of a failure
TEST_FOCUSOnly run the test provided within the parentheses This is useful for debugging when you want to reduce noise, but should never be pushed Intended to be used in the manner of TEST_FOCUS(/datum/unit_test/math)
UNIT_TEST_PASSEDConstants indicating unit test completion status
TEST_PRECapture pre-unit test mapping error reports. Maybe one day we can take this out back and shoot it.
TEST_MAP_STANDARDSEnsures map standards. Runs before standard unit tests as for production maps, these are more important.
TEST_DEFAULTStandard unit test priority
TEST_LONGERAfter most test steps, used for tests that run long so shorter issues can be noticed faster
TEST_DEL_WORLDThis must be the last test to run due to the inherent nature of the test iterating every single tangible atom in the game and qdeleting all of them (while taking long sleeps to make sure the garbage collector fires properly) taking a large amount of time.
TRAIT_SOURCE_UNIT_TESTSA trait source when adding traits through unit tests
ALLOCATE_BOTTOM_LEFTHelper to allocate a new object with the implied type (the type of the variable it's assigned to) in the corner of the test room

Define Details

ALLOCATE_BOTTOM_LEFT

Helper to allocate a new object with the implied type (the type of the variable it's assigned to) in the corner of the test room

TEST_ASSERT

Asserts that a condition is true If the condition is not true, fails the test

TEST_ASSERT_EQUAL

Asserts that the two parameters passed are equal, fails otherwise Optionally allows an additional message in the case of a failure

TEST_ASSERT_NOTEQUAL

Asserts that the two parameters passed are not equal, fails otherwise Optionally allows an additional message in the case of a failure

TEST_ASSERT_NOTNULL

Asserts that a parameter is not null

TEST_ASSERT_NULL

Asserts that a parameter is null

TEST_DEFAULT

Standard unit test priority

TEST_DEL_WORLD

This must be the last test to run due to the inherent nature of the test iterating every single tangible atom in the game and qdeleting all of them (while taking long sleeps to make sure the garbage collector fires properly) taking a large amount of time.

TEST_FAIL

For advanced cases, fail unconditionally but don't return (so a test can return multiple results)

TEST_FOCUS

Only run the test provided within the parentheses This is useful for debugging when you want to reduce noise, but should never be pushed Intended to be used in the manner of TEST_FOCUS(/datum/unit_test/math)

TEST_LONGER

After most test steps, used for tests that run long so shorter issues can be noticed faster

TEST_MAP_STANDARDS

Ensures map standards. Runs before standard unit tests as for production maps, these are more important.

TEST_PRE

Capture pre-unit test mapping error reports. Maybe one day we can take this out back and shoot it.

TEST_SKIP

Mark the test as skipped.

TRAIT_SOURCE_UNIT_TESTS

A trait source when adding traits through unit tests

UNIT_TEST_PASSED

Constants indicating unit test completion status