]> git.ipfire.org Git - thirdparty/util-linux.git/blob - Documentation/howto-tests.txt
tests: add documentation about environment variables
[thirdparty/util-linux.git] / Documentation / howto-tests.txt
1
2 util-linux regression tests
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 It's expected that for each invasive change or important bugfix you will
6 include a test to your patch.
7
8 Compile tests & run basic tests:
9
10 $ make check
11
12 Note that the configure option --disable-static disables many of libmount and
13 libblkid unit tests.
14
15 Run all tests including tests that require root permissions:
16
17 # cd tests
18 # ./run.sh [--verbose] [--memcheck]
19
20 Alternatively using sudo and make:
21
22 $ make check TS_COMMAND="true"
23 $ sudo -E make check TS_OPTS="--parallel=1"
24
25 note that as root you have to manually remove output and diff directories
26
27 # rm -rf output diff
28
29 or run 'make clean' as root.
30
31
32 Run subset of tests:
33
34 $ ./run.sh <test_directory-name>
35
36 for example:
37
38 $ ./run.sh blkid
39 $ ./run.sh libmount
40
41
42
43 *** WARNING for root users ***
44
45 The tests touch your /etc/fstab, initialize loop devices or scsi_debug devices
46 if executed with root permissions.
47
48 Please, be careful and use these tests only for development and never on
49 production system.
50
51
52 environment variables
53 ---------------------
54
55 TS_COMMAND
56
57 Evaluated by "make check" to override the default command (run.sh).
58 Example:
59 - build all test dependencies, but skip the actual test
60 $ make check TS_COMMAND="true"
61
62 TS_OPTS
63
64 Evaluated by "make check" to pass options.to run.sh (see ./run.sh --help).
65 Examples:
66 - run utmp tests only
67 $ make check TS_OPTS="--parallel=1 utmp"
68
69 TS_OPT_testdir_[testscript_]fake="<yes|no>"
70
71 Evaluated by any test script to skip certain tests.
72 Examples:
73 - skip all the tests within "fdisk" test-direcrory:
74 $ make check TS_OPT_fdisk_fake="yes"
75
76 - skip only "fdisk/bsd" test:
77 $ make check TS_OPT_fdisk_bsd_fake="yes"
78
79 - skip all "fdisk" tests except fdisk/bsd:
80 $ make check TS_OPT_fdisk_fake="yes" TS_OPT_fdisk_bsd_fake="no"
81
82 TS_OPT_testdir_[testscript_]known_fail="<yes|no>"
83
84 Similar usage like TS_OPT_*_fake above. "known_fail" means that the given
85 test will run but (negative) results will be ignored. The build log and test
86 diffs will still remind you about the issue.
87
88 TS_OPT_testdir_[testscript_]verbose="<yes|no>"
89
90 Set verbosity for certain tests. Similar usage like TS_OPT_*_fake above.
91
92 TS_OPT_testdir_[testscript_]memcheck="<yes|no>"
93
94 Run certain tests with valgrind. Similar usage like TS_OPT_*_fake above.