]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests: detect empty config test sets
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 8 Jul 2020 07:21:09 +0000 (09:21 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 8 Dec 2020 17:15:01 +0000 (18:15 +0100)
tests/config/test.cfg

index f961ee4db3d9d04d2316140a6add7adb63bc5fcf..9efcaf9cdbd8170a5d84c041fc8cfd4ee39e98eb 100644 (file)
@@ -32,11 +32,14 @@ assert(type(tests) == 'table',
 
 local runtest = require('test_utils').test
 worker.coroutine(function ()
+       local at_least_one_test = false
        for idx, t in ipairs(tests) do
                assert(type(t) == 'function',
                        string.format('test table idx %d in file %s'
                                .. 'is not a function', idx, env.TEST_FILE))
+               at_least_one_test = true
                runtest(t)
        end
+       assert(at_least_one_test, 'test set is empty?! a typo in function name?')
        done()
 end)