Makes integration test results be in color and have annotations (#66649)

About The Pull Request

    Separated compiling the integration tests and running them as separate steps for organization purposes.
    Added a TEST_ASSERT_NULL(value, reason) and TEST_ASSERT_NOTNULL(value, reason) because those are conceptually simple tests.
    Makes the PASS and FAIL prefixes in the integration test log be green and red for better readability.
    Failure reasons now display the file and line number.
        In order to achieve this, direct calls to Fail() are now wrapped in a macro, TEST_FAIL(), as Fail() itself needs preprocessor stuff passed to it.
        In the midst of updating it, I noticed multiple cases of tests directly calling Fail() and returning when they should have used a better macro, so those were updated. There was at least one case where it appeared that the code assumed that the test ended at Fail(), but made no attempt to do so, such as with the RCD test.
        Feel free to double check all of the changed unit tests in case I made a functional behavior change, but they currently pass.
    To take advantage of the previous change, failures are now marked as annotations. Note that outside of github, this creates an ugly-looking line but the primary environment is as a github action.

Examples with intentionally botched unit test:

image

image

image
Why It's Good For The Game

Makes inspecting failed unit tests significantly easier.
Changelog

N/A
This commit is contained in:
Tastyfish
2022-05-03 21:19:01 -04:00
committed by GitHub
parent b9e11b7f67
commit bca463316b
47 changed files with 155 additions and 129 deletions
@@ -4,7 +4,7 @@
for (var/obj/modular_map_root/map_root_type as anything in subtypesof(/obj/modular_map_root))
var/config_file = initial(map_root_type.config_file)
if (!fexists(config_file))
Fail("[map_root_type] points to a config file which does not exist!")
TEST_FAIL("[map_root_type] points to a config file which does not exist!")
continue
if (rustg_read_toml_file(config_file) == null)
Fail("[map_root_type] points to a config file which is invalid!")
TEST_FAIL("[map_root_type] points to a config file which is invalid!")