enu
enu copied to clipboard
Add unit testing infrastructure
Summary
- Add three types of tests: unit tests, VM script tests, and in-world tests
- Add
nimble testcommand that runs all test types with proper exit codes - Integrate tests into CI workflows (macOS and Windows get world tests, Linux skips due to server build)
Changes
Test Infrastructure
- Unit tests (
tests/unit/) - test ScriptCtx, serializers without Godot - VM tests (
tests/vm/) - test vmlib API via command-line script execution - In-world tests (
vmlib/worlds/tests/) - tests that run inside Enu
Command Line Flags
--level-dir <path>- load specific level directory--enu-test- enable test mode (auto-exit when scripts finish)
New API
has_block_at(position)- check if block exists at world positionblock_color_at(position)- get color of block at world position
Bug Fixes
- Fixed voxel lookup to also check batched voxels during script execution
Known Bugs (documented with commented-out tests)
left/right/up/downin move mode all move in forward direction
Test plan
- [x]
nimble unit_testspasses - [x]
nimble vm_testspasses - [x]
nimble world_testspasses - [x]
nimble testruns all three and reports correctly