[Dnsmasq-discuss] [PATCH] unittests

Petr Menšík pemensik at redhat.com
Tue Apr 13 13:18:04 UTC 2021


Hi Simon and other dnsmasq friends,

after some struggling with Makefile support, I am sending my dnsmasq
unit tests. It uses another directory with tests specific code. I moved
some common parts to Makefile.config, in order to be able to reuse them.
Unit tests are under tests directory with own Makefile.

New target make check should work also from top directory. Some checks
would work only from tests directory (make kyua). Current coverage is
rather poor, but I hope can be used as a building block to better tests.
Especially option parsing tests are easy to write. Testing of sending
and receiving packets seems to be difficult, it should be tested by
different kind of test IMHO.

First is attempt to refactor, the second is what evolved into more
complex set of tests.

Original separate commits are still available on github [1].

What do you think?

Cheers,
Petr

1. https://github.com/InfrastructureServices/dnsmasq/tree/unittests
-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemensik at redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Merge-unittests-as-a-single-commit.patch
Type: text/x-patch
Size: 63276 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20210413/cea4718d/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Reduce-code-duplication-reuse-existing-functions.patch
Type: text/x-patch
Size: 2327 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20210413/cea4718d/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20210413/cea4718d/attachment-0001.sig>


More information about the Dnsmasq-discuss mailing list