]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
tests/config: added a TAP-based test environment for modules/configs
authorMarek Vavruša <mvavrusa@cloudflare.com>
Sun, 26 Nov 2017 00:23:46 +0000 (16:23 -0800)
committerPetr Špaček <petr.spacek@nic.cz>
Tue, 28 Nov 2017 10:21:11 +0000 (11:21 +0100)
commitf41676d299309b775401994079788647d6798e8b
treed658a8ffe9744a9a9dd024b6191b2e2184a539eb
parent5830586ee052318622d88da1534d3db9d5afe0cb
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).
15 files changed:
.gitignore
.gitmodules
.luacheckrc
modules/hints/hints_test.lua [new file with mode: 0644]
modules/hints/hints_test.zone [moved from tests/config/hints/hints.zone with 100% similarity]
modules/predict/predict_test.lua [moved from tests/config/predict/test.cfg with 62% similarity]
tests/config/basic/test.cfg [deleted file]
tests/config/basic_test.lua [new file with mode: 0644]
tests/config/hints/test.cfg [deleted file]
tests/config/runtest.sh
tests/config/tapered [new submodule]
tests/config/test.cfg [new file with mode: 0644]
tests/config/test_config.mk
tests/config/test_utils.lua
tests/tests.mk