diff options
author | Alexander Todorov <atodorov@redhat.com> | 2015-07-07 19:55:38 +0300 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2015-07-13 14:31:57 -0700 |
commit | 03e6d18945fecea98aea96544e5dd2a043ef0511 (patch) | |
tree | 804212601406cef85d1cce7344cbd44d5c2d6ba9 /README-hacking | |
parent | 6e7e98b09dd7d0e826c5e1d62d0819513785fbd2 (diff) | |
download | parted-03e6d18945fecea98aea96544e5dd2a043ef0511.tar.gz |
Fwd: [PATCH 2/2] add verbose test documentation
Diffstat (limited to 'README-hacking')
-rw-r--r-- | README-hacking | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/README-hacking b/README-hacking index aeacabb..6d466b5 100644 --- a/README-hacking +++ b/README-hacking @@ -478,12 +478,7 @@ Nearly every significant change must be accompanied by a test suite addition that exercises it. If you fix a bug, add at least one test that fails without the patch, but that succeeds once your patch is applied. If you add a feature, add tests to exercise as much of the new code -as possible. Note to run tests/new-test in isolation you can do: - - (cd tests && make check TESTS=new-test VERBOSE=yes) - -There are many tests in the tests/ directories. Use one of the -init.sh-using scripts as a template. +as possible. If writing tests is not your thing, don't worry too much about it, but do provide scenarios, input/output pairs, or whatever, along with @@ -491,6 +486,34 @@ examples of running the tool to demonstrate the new or changed feature, and someone else will massage that into a test (writing portable tests can be a challenge). +Executing the tests +=================== + +All test cases can be executed by running the command: + + make check + +To run individual tests in isolation you can do: + + cd tests/ + make check TESTS=new-test VERBOSE=yes + +Writing new tests +================= + +parted's test suite consists of shell scripts and C programs exercising +specific parted functionality. There are also a few helper scripts written +in Python and Perl. + +To write a new test use one of the init.sh-using scripts as a template and +update the Makefile.am file. Shell test scripts are listed in the TESTS +variable and the C programs in the check_PROGRAMS variable. The EXTRA_DIST +variable lists the remaining helper scripts. + +libparted's tests are under the libparted/tests/ directory. They are written +in C using the check test framework <http://check.sourceforge.net/> and +executed from shell scripts. Don't forget to add new tests in Makefile.am. +See the TESTS, check_PROGRAMS and xxxx_SOURCES variables. Copyright assignment ==================== |