Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=d46075a1...
Commit: d46075a179cb83dc0b17667649f9465aace8eeff
Parent: 806495ab5e9f83b107bcca25def28415c1dc192b
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jan 14 12:30:04 2015 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Apr 1 16:51:35 2015 +0100
gfs2-utils tests: Improve docs
Add a pointer to doc/README.tests in README.build and be more consistent
about how the test suite is run in doc/README.tests. Add example usage
and mention the TOPTS argument.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
README.build | 3 ++-
doc/README.tests | 32 ++++++++++++++++++++++++--------
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/README.build b/README.build
index 2aad6ab..f4ebe53 100644
--- a/README.build
+++ b/README.build
@@ -29,4 +29,5 @@ To install gfs2-utils, run:
make install
-See also doc/README.contributing for details on submitting patches.
+See also doc/README.contributing for details on submitting patches and
+doc/README.tests for more details regarding the test suite.
diff --git a/doc/README.tests b/doc/README.tests
index 79f51f6..1b90a0c 100644
--- a/doc/README.tests
+++ b/doc/README.tests
@@ -1,16 +1,30 @@
Working with the gfs2-utils test suite
--------------------------------------
+Overview
+--------
The test suite in the tests directory of the gfs2-utils source tree is based on
the Autotest framework provided by Autoconf. The basic idea is that the
testsuite.at file is the main source file for the tests, written in m4 and
-generating a bourne shell script called testsuite.
+generating a bourne shell script called testsuite, which we run with 'make
check'.
-When run, either using 'make check' or directly from within the tests
-directory, the testsuite script sources atconfig and atlocal for configuration
-and then runs the whole testsuite or a specified set of tests (see ./testsuite
--h for help).
+When run, the test suite sources tests/atconfig and tests/atlocal for
+configuration and then runs the whole suite or a specified set of tests,
+depending on options passed to the test suite using TOPTS. For example, to see
+a list of available options, use 'make check TOPTS=-h' and to see a numbered
+list of the available tests, use 'make check TOPTS=-l'.
+A subset of the available tests can be run using keywords and/or by specifying
+the test ID numbers in TOPTS, e.g. make check TOPTS='-k mkfs 24 25'
+
+Test output is captured and, if a test fails, a log is kept in
+tests/testsuite.dir/$n/testsuite.log where $n is the test's ID number. Failed
+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
+-------------
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
@@ -32,15 +46,17 @@ do not fit into an existing category, in which case AT_BANNER can be
used to
group them, and they can be organised into a new .at file and sourced from
testsuite.at.
-Since the tests can be run individually (e.g. ./testsuite 15) any new tests
-which require the dummy volume $GFS_TGT to be present should call GFS_TGT_REGEN
-before attempting to use it.
+As the tests can be run individually, any new tests which require the dummy
+volume $GFS_TGT to be present should call GFS_TGT_REGEN before attempting to
+use it.
Documentation for Autotest, including the AT_* macros used to define tests, can
be found in the autoconf manual at:
http://www.gnu.org/software/autoconf/manual/index.html
+Generating coverage reports
+---------------------------
Test coverage instrumentation can be enabled using the --enable-gcov option at
the configure stage. Once the tools have been built and run with this option
enabled, coverage data will be written to files in the source directories for