This allows tests to test these functions without needing to include the test
wrapper directly (now ci/test.lua, formerly test/main.lua). Hopefully this
location is also more stable, similar to other libraries that are already tested.
These errors could previously go undetected, since they were easy to miss at the
end of the output and did not cause run-tests.py to fail.
This change adds a `*` pseudo-entry to test_status.json, which is set to
"failed" if any tests failed *or* failed to load. This avoids the need to change
run-tests.py, which is cached on Buildmaster.
See #1815
- unit_action_fields(): handled primitive union members correctly
- unit_action_type(): added messages to make failures easier to diagnose
- Also removed redundant checks that effectively checked that
`enum.attrs[k] == enum.attrs[v]` - this is out of scope of union tests
- explain modes, done command, and test_config.json file format
- also be more flexible with how the done command is formatted (can now be
passed as either separate tokens or as a single quoted string)
- print the filter values when filtering tests
and add tests. to write test the table_eq function itself, I expose it
in the text env via expect_raw. if we don't want to do this,
alternatives could be:
1. add the test to main.lua itself
2. expose the expect.table_eq function via a test_hooks variable. then
test.lua could require main.lua and access the function via the hook.
may need to update main.lua a bit to ensure it does not run when it
is "require"d
- make test config controllable via commandline params
- enable filtering by mode
- fix test filter code (it would misbehave if multiple filters were
specified)
- allow done_command to have multiple tokens (before it could only be
one word)
- remove preemptive check for the title screen. it is still checked when a
test actually requires that the game is on the title screen