tests/config: added a TAP-based test environment for modules/configs
I moved the test files to module directories because it allows vendoring of whole modules including tests etc. The test environment provides convenience functions and produces test output in TAP format. Ideally all tests should use a common format, so that CI can parse it provide better test output on PRs. It seems like Gitlab CI doesn't support anything yet, but there are two sort-of standards supported in CI tools - TAP and JUnit. I chose TAP because it's easier to read for humans, cmocka supports it, and it should be easier to adapt Deckard. There are also tools to convert TAP into JUnit XML file. Also added more tests for global functions and variables, and the test tool now also tracks coverage (if `luacov` is installed).
parent
5830586e
Branches
Tags
Showing
- .gitignore 2 additions, 0 deletions.gitignore
- .gitmodules 3 additions, 0 deletions.gitmodules
- .luacheckrc 2 additions, 1 deletion.luacheckrc
- modules/hints/hints_test.lua 34 additions, 0 deletionsmodules/hints/hints_test.lua
- modules/hints/hints_test.zone 0 additions, 0 deletionsmodules/hints/hints_test.zone
- modules/predict/predict_test.lua 18 additions, 19 deletionsmodules/predict/predict_test.lua
- tests/config/basic/test.cfg 0 additions, 26 deletionstests/config/basic/test.cfg
- tests/config/basic_test.lua 34 additions, 0 deletionstests/config/basic_test.lua
- tests/config/hints/test.cfg 0 additions, 44 deletionstests/config/hints/test.cfg
- tests/config/runtest.sh 6 additions, 5 deletionstests/config/runtest.sh
- tests/config/tapered 1 addition, 0 deletionstests/config/tapered
- tests/config/test.cfg 32 additions, 0 deletionstests/config/test.cfg
- tests/config/test_config.mk 9 additions, 8 deletionstests/config/test_config.mk
- tests/config/test_utils.lua 20 additions, 30 deletionstests/config/test_utils.lua
- tests/tests.mk 1 addition, 1 deletiontests/tests.mk
Please register or sign in to comment