mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
docs/devel: update instruction on how to add new unit tests
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
da00d067ea
commit
bab88ead6f
2 changed files with 27 additions and 14 deletions
|
@ -41,15 +41,16 @@ add a new unit test:
|
|||
test. The test code should be organized with the glib testing framework.
|
||||
Copying and modifying an existing test is usually a good idea.
|
||||
|
||||
3. Add the test to ``tests/Makefile.include``. First, name the unit test
|
||||
program and add it to ``$(check-unit-y)``; then add a rule to build the
|
||||
executable. For example:
|
||||
3. Add the test to ``tests/meson.build``. The unit tests are listed in a
|
||||
dictionary called ``tests``. The values are any additional sources and
|
||||
dependencies to be linked with the test. For a simple test whose source
|
||||
is in ``tests/foo-test.c``, it is enough to add an entry like::
|
||||
|
||||
.. code::
|
||||
|
||||
check-unit-y += tests/foo-test$(EXESUF)
|
||||
tests/foo-test$(EXESUF): tests/foo-test.o $(test-util-obj-y)
|
||||
...
|
||||
{
|
||||
...
|
||||
'foo-test': [],
|
||||
...
|
||||
}
|
||||
|
||||
Since unit tests don't require environment variables, the simplest way to debug
|
||||
a unit test failure is often directly invoking it or even running it under
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue