Skip to contentSkip to conversation

docs/devel/testing.rst: Fix referencies to unit tests

PATCH Superseded Wainer dos Santos Moschetta 3 participants 4 messages Mar 17, 2021 – Mar 18, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/devel/testing.rst: Fix referencies to unit tests

With the recent move of the unit tests to tests/unit directory some instructions under the "Unit tests" section became imprecise, which are fixed by this change.

Related-to: da668aa15b99 (tests: Move unit tests into a separate directory)

---
 docs/devel/testing.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
docs/devel/testing.rst +3 -3
index 1434a50cc4..1da4c4e4c4 100644
@@ -34,17 +34,17 @@ If you are writing new code in QEMU, consider adding a unit test, especially
 for utility modules that are relatively stateless or have few dependencies. To
 add a new unit test:
 
-1. Create a new source file. For example, ``tests/foo-test.c``.
+1. Create a new source file. For example, ``tests/unit/foo-test.c``.
 
 2. Write the test. Normally you would include the header file which exports
    the module API, then verify the interface behaves as expected from your
    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/meson.build``. The unit tests are listed in a
+3. Add the test to ``tests/unit/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::
+   is in ``tests/unit/foo-test.c``, it is enough to add an entry like::
 
      {
        ...
Signature · 1 line
2.29.2
#1 lore raw

typo in the commit summary; "references to"

Quoted 5 lines · Wainer dos Santos Moschetta

With the recent move of the unit tests to tests/unit directory some instructions under the "Unit tests" section became imprecise, which are fixed by this change.

Related-to: da668aa15b99 (tests: Move unit tests into a separate directory)

You can probably just use "Fixes", even though nothing is technically broken to avoid introducing a new one-off tag type.

Quoted 31 lines
---
  docs/devel/testing.rst | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
docs/devel/testing.rst +3 -3
index 1434a50cc4..1da4c4e4c4 100644
@@ -34,17 +34,17 @@ If you are writing new code in QEMU, consider adding a unit test, especially
  for utility modules that are relatively stateless or have few dependencies. To
  add a new unit test:
 
-1. Create a new source file. For example, ``tests/foo-test.c``.
+1. Create a new source file. For example, ``tests/unit/foo-test.c``.
 
  2. Write the test. Normally you would include the header file which exports
     the module API, then verify the interface behaves as expected from your
     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/meson.build``. The unit tests are listed in a
+3. Add the test to ``tests/unit/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::
+   is in ``tests/unit/foo-test.c``, it is enough to add an entry like::
 
       {
...
#2 lore raw
Quoted 10 lines · John Snow

typo in the commit summary; "references to"

Quoted 5 lines · Wainer dos Santos Moschetta

With the recent move of the unit tests to tests/unit directory some instructions under the "Unit tests" section became imprecise, which are fixed by this change.

Related-to: da668aa15b99 (tests: Move unit tests into a separate directory)

You can probably just use "Fixes", even though nothing is technically broken to avoid introducing a new one-off tag type.

Yeah, I wasn't sure whether to use "Fixes" or not. Thanks for the tip!

Going to send a v2 to fix those issues.

- Wainer

Quoted 32 lines
Quoted 31 lines

---
  docs/devel/testing.rst | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
docs/devel/testing.rst +0 -0
index 1434a50cc4..1da4c4e4c4 100644
@@ -34,17 +34,17 @@ If you are writing new code in QEMU, consider 

adding a unit test, especially
  for utility modules that are relatively stateless or have few dependencies. To add a new unit test:
  -1. Create a new source file. For example, ``tests/foo-test.c``. +1. Create a new source file. For example, ``tests/unit/foo-test.c``.
    2. Write the test. Normally you would include the header file which exports the module API, then verify the interface behaves as expected from your 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/meson.build``. The unit tests are listed in a +3. Add the test to ``tests/unit/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::
+   is in ``tests/unit/foo-test.c``, it is enough to add an entry like::
         {
         ...

Reviewed-by on v1 1/1
#3 lore raw
In reply to Wainer dos Santos Moschetta
Quoted 26 lines · Wainer dos Santos Moschetta

With the recent move of the unit tests to tests/unit directory some instructions under the "Unit tests" section became imprecise, which are fixed by this change.

Related-to: da668aa15b99 (tests: Move unit tests into a separate directory)

---
  docs/devel/testing.rst | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
docs/devel/testing.rst +1 -1
index 1434a50cc4..1da4c4e4c4 100644
@@ -34,17 +34,17 @@ If you are writing new code in QEMU, consider adding a unit test, especially
  for utility modules that are relatively stateless or have few dependencies. To
  add a new unit test:
 
-1. Create a new source file. For example, ``tests/foo-test.c``.
+1. Create a new source file. For example, ``tests/unit/foo-test.c``.
 
  2. Write the test. Normally you would include the header file which exports
     the module API, then verify the interface behaves as expected from your
     test. The test code should be organized with the glib testing framework.
     Copying and modifying an existing test is usually a good idea.

docs/devel/testing.rst If you are writing new code in QEMU, consider adding a unit test, especially · line 49

Quoted 10 lines
docs/devel/testing.rst +2 -2
 
-3. Add the test to ``tests/meson.build``. The unit tests are listed in a
+3. Add the test to ``tests/unit/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::
+   is in ``tests/unit/foo-test.c``, it is enough to add an entry like::
 
       {
...