]> git.ipfire.org Git - thirdparty/util-linux.git/blame - Documentation/howto-tests.txt
Merge branch 'logger-wrong-typo' of https://github.com/chentooerl/util-linux
[thirdparty/util-linux.git] / Documentation / howto-tests.txt
CommitLineData
e83446da
KZ
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
55ff4da8 8 Compile binaries, libs, extra test programs and run the basic tests:
922e6775 9
a9770f7f 10 $ make check
e83446da 11
55ff4da8
KZ
12 Compile extra test programs only:
13
14 $ make check-programs
15
43ffdc82
KZ
16 Note that the configure option --disable-static disables many of libmount and
17 libblkid unit tests.
18
a9770f7f 19 Run all tests including tests that require root permissions:
e83446da 20
a9770f7f 21 # cd tests
55ff4da8 22 # ./run.sh [options, see --help]
e83446da 23
f1e744f2
RM
24 Alternatively using sudo and make:
25
55ff4da8 26 $ make check-programs
f1e744f2
RM
27 $ sudo -E make check TS_OPTS="--parallel=1"
28
91f98496
KZ
29 note that as root you have to manually remove output and diff directories
30
31 # rm -rf output diff
32
33 or run 'make clean' as root.
34
35
e349c4f8 36 Run subset of tests:
e83446da 37
55ff4da8 38 $ cd tests
a9770f7f 39 $ ./run.sh <test_directory-name>
e349c4f8
KZ
40
41 for example:
42
a9770f7f
KZ
43 $ ./run.sh blkid
44 $ ./run.sh libmount
e83446da 45
55ff4da8
KZ
46 or individual test script, for example:
47
48 $ ./ts/cal/year
49
d7030b04
KZ
50 The tests is possible to exclude by ./run.sh --exclude=<list> where the
51 <list> is blank separated test names in format "testdir/testname", for example:
52
53 $ ./run.sh --exclude="mount/move"
54
55 The --exclude is evaluated by the ./run.sh script only. See below
56
57 TS_OPT_testdir_[testscript_]fake=
58
59 environment variable which provides more powerful functionality to skip tests.
66822df3
KZ
60
61
a9770f7f 62 *** WARNING for root users ***
66822df3 63
91f98496
KZ
64 The tests touch your /etc/fstab, initialize loop devices or scsi_debug devices
65 if executed with root permissions.
66
67 Please, be careful and use these tests only for development and never on
68 production system.
f1e744f2 69
0f311c7a
EV
70fuzz targets
71------------
72
73The fuzz targets can be built and run along with the other tests (after installing
74clang):
75
76 $ ./tools/config-gen fuzz
77 $ make check
f1e744f2
RM
78
79environment variables
80---------------------
81
82TS_COMMAND
83
84 Evaluated by "make check" to override the default command (run.sh).
85 Example:
86 - build all test dependencies, but skip the actual test
87 $ make check TS_COMMAND="true"
88
89TS_OPTS
90
91 Evaluated by "make check" to pass options.to run.sh (see ./run.sh --help).
92 Examples:
93 - run utmp tests only
94 $ make check TS_OPTS="--parallel=1 utmp"
95
96TS_OPT_testdir_[testscript_]fake="<yes|no>"
97
98 Evaluated by any test script to skip certain tests.
99 Examples:
84bf1f68 100 - skip all the tests within "fdisk" test-directory:
f1e744f2
RM
101 $ make check TS_OPT_fdisk_fake="yes"
102
103 - skip only "fdisk/bsd" test:
104 $ make check TS_OPT_fdisk_bsd_fake="yes"
105
106 - skip all "fdisk" tests except fdisk/bsd:
107 $ make check TS_OPT_fdisk_fake="yes" TS_OPT_fdisk_bsd_fake="no"
108
109TS_OPT_testdir_[testscript_]known_fail="<yes|no>"
110
111 Similar usage like TS_OPT_*_fake above. "known_fail" means that the given
112 test will run but (negative) results will be ignored. The build log and test
113 diffs will still remind you about the issue.
114
115TS_OPT_testdir_[testscript_]verbose="<yes|no>"
116
117 Set verbosity for certain tests. Similar usage like TS_OPT_*_fake above.
118
119TS_OPT_testdir_[testscript_]memcheck="<yes|no>"
120
121 Run certain tests with valgrind. Similar usage like TS_OPT_*_fake above.
eac8f358
KZ
122
123
2bb3aa36 124External services
eac8f358
KZ
125-----------------
126
1524cb27 127Coveralls coverage reports
eac8f358 128
1524cb27 129 URL: https://coveralls.io/github/util-linux/util-linux
eac8f358 130
077650ff 131lgtm CI - automatically executed security code analysis
eac8f358 132
cd252c66 133 URL: https://lgtm.com/projects/g/util-linux/util-linux/
2092de0f
EV
134
135Coverity Scan
136
c881bec5 137 URL: https://scan.coverity.com/projects/karelzak-util-linux
2092de0f
EV
138
139Fossies codespell report
140
141 URL: https://fossies.org/linux/test/util-linux-master.tar.gz/codespell.html
0f311c7a
EV
142
143OSS-Fuzz
144
145 URL: https://google.github.io/oss-fuzz/
146 URL: https://oss-fuzz-build-logs.storage.googleapis.com/index.html#util-linux
147 URL: https://oss-fuzz.com/coverage-report/job/libfuzzer_asan_util-linux/latest
148
149CIFuzz
150
151 URL: https://google.github.io/oss-fuzz/getting-started/continuous-integration/
cd252c66 152 URL: https://github.com/util-linux/util-linux/actions?query=workflow%3ACIFuzz