From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 3/3] Describe the unit tests in README.tests
Date: Fri, 11 Sep 2020 15:42:43 +0100 [thread overview]
Message-ID: <20200911144243.667554-4-anprice@redhat.com> (raw)
In-Reply-To: <20200911144243.667554-1-anprice@redhat.com>
Signed-off-by: Andrew Price <anprice@redhat.com>
---
doc/README.tests | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/doc/README.tests b/doc/README.tests
index 1b90a0c4..292d2ae7 100644
--- a/doc/README.tests
+++ b/doc/README.tests
@@ -23,8 +23,8 @@ tests can be re-run using make check TOPTS='--recheck' although it's better to
re-run the entire suite after fixing tests as a fix for one test could break
another.
-Writing tests
--------------
+Smoke/regression tests
+----------------------
A number of GFS2-specific convenience macros have been defined in testsuite.at
to make defining new tests quick and easy. Also, some variables have been
defined in atlocal.in so that full paths to programs do not have to be included
@@ -55,6 +55,33 @@ be found in the autoconf manual at:
http://www.gnu.org/software/autoconf/manual/index.html
+Unit tests
+----------
+A unit test framework for each of the main utils and libgfs2 is included in its
+source directory. These tests are based on the libcheck C unit test library and
+are built and run by 'make check'. Generally, there should be one check "Suite"
+defined for each source file of the util, named with a check_ prefix,
+containing one or more test cases defined for each externally-visible function.
+For example:
+
+ check_libgfs2 (main file: check_libgfs2.c)
+ |--------Suite: rgrp.c (in check_rgrp.c)
+ | |---------- Test case: test_rbm_find_good
+ | |-----------Test case: test_rbm_find_bad
+ |--------Suite: meta.c (in check_meta.c)
+ | |-----------Test case: test_lgfs2_meta
+ etc. etc.
+
+The build rules for the unit tests are separated into a checks.am file in each
+source directory. Documentation for writing libcheck unit tests can be found
+at:
+
+ https://libcheck.github.io/check/doc/check_html/index.html
+
+Autoconf's automatically generated test driver script only prints one line for
+each unit test executable run instead of one line per test case. To view
+details of unit test failures, see the generated .log and .trs files.
+
Generating coverage reports
---------------------------
Test coverage instrumentation can be enabled using the --enable-gcov option at
--
2.26.2
prev parent reply other threads:[~2020-09-11 14:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-11 14:42 [Cluster-devel] [PATCH 0/3] gfs2-utils: Unit test framework improvements Andrew Price
2020-09-11 14:42 ` [Cluster-devel] [PATCH 1/3] Reorganise unit tests Andrew Price
2020-09-11 14:42 ` [Cluster-devel] [PATCH 2/3] Stub out unit tests for the main gfs2-utils Andrew Price
2020-09-11 14:42 ` Andrew Price [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200911144243.667554-4-anprice@redhat.com \
--to=anprice@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.