]>
Commit | Line | Data |
---|---|---|
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 | ||
a9770f7f | 8 | Compile tests & run basic tests: |
922e6775 | 9 | |
a9770f7f | 10 | $ make check |
e83446da | 11 | |
43ffdc82 KZ |
12 | Note that the configure option --disable-static disables many of libmount and |
13 | libblkid unit tests. | |
14 | ||
a9770f7f | 15 | Run all tests including tests that require root permissions: |
e83446da | 16 | |
a9770f7f KZ |
17 | # cd tests |
18 | # ./run.sh [--verbose] [--memcheck] | |
e83446da | 19 | |
f1e744f2 RM |
20 | Alternatively using sudo and make: |
21 | ||
22 | $ make check TS_COMMAND="true" | |
23 | $ sudo -E make check TS_OPTS="--parallel=1" | |
24 | ||
91f98496 KZ |
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 | ||
e349c4f8 | 32 | Run subset of tests: |
e83446da | 33 | |
a9770f7f | 34 | $ ./run.sh <test_directory-name> |
e349c4f8 KZ |
35 | |
36 | for example: | |
37 | ||
a9770f7f KZ |
38 | $ ./run.sh blkid |
39 | $ ./run.sh libmount | |
e83446da | 40 | |
d7030b04 KZ |
41 | The tests is possible to exclude by ./run.sh --exclude=<list> where the |
42 | <list> is blank separated test names in format "testdir/testname", for example: | |
43 | ||
44 | $ ./run.sh --exclude="mount/move" | |
45 | ||
46 | The --exclude is evaluated by the ./run.sh script only. See below | |
47 | ||
48 | TS_OPT_testdir_[testscript_]fake= | |
49 | ||
50 | environment variable which provides more powerful functionality to skip tests. | |
66822df3 KZ |
51 | |
52 | ||
a9770f7f | 53 | *** WARNING for root users *** |
66822df3 | 54 | |
91f98496 KZ |
55 | The tests touch your /etc/fstab, initialize loop devices or scsi_debug devices |
56 | if executed with root permissions. | |
57 | ||
58 | Please, be careful and use these tests only for development and never on | |
59 | production system. | |
f1e744f2 RM |
60 | |
61 | ||
62 | environment variables | |
63 | --------------------- | |
64 | ||
65 | TS_COMMAND | |
66 | ||
67 | Evaluated by "make check" to override the default command (run.sh). | |
68 | Example: | |
69 | - build all test dependencies, but skip the actual test | |
70 | $ make check TS_COMMAND="true" | |
71 | ||
72 | TS_OPTS | |
73 | ||
74 | Evaluated by "make check" to pass options.to run.sh (see ./run.sh --help). | |
75 | Examples: | |
76 | - run utmp tests only | |
77 | $ make check TS_OPTS="--parallel=1 utmp" | |
78 | ||
79 | TS_OPT_testdir_[testscript_]fake="<yes|no>" | |
80 | ||
81 | Evaluated by any test script to skip certain tests. | |
82 | Examples: | |
83 | - skip all the tests within "fdisk" test-direcrory: | |
84 | $ make check TS_OPT_fdisk_fake="yes" | |
85 | ||
86 | - skip only "fdisk/bsd" test: | |
87 | $ make check TS_OPT_fdisk_bsd_fake="yes" | |
88 | ||
89 | - skip all "fdisk" tests except fdisk/bsd: | |
90 | $ make check TS_OPT_fdisk_fake="yes" TS_OPT_fdisk_bsd_fake="no" | |
91 | ||
92 | TS_OPT_testdir_[testscript_]known_fail="<yes|no>" | |
93 | ||
94 | Similar usage like TS_OPT_*_fake above. "known_fail" means that the given | |
95 | test will run but (negative) results will be ignored. The build log and test | |
96 | diffs will still remind you about the issue. | |
97 | ||
98 | TS_OPT_testdir_[testscript_]verbose="<yes|no>" | |
99 | ||
100 | Set verbosity for certain tests. Similar usage like TS_OPT_*_fake above. | |
101 | ||
102 | TS_OPT_testdir_[testscript_]memcheck="<yes|no>" | |
103 | ||
104 | Run certain tests with valgrind. Similar usage like TS_OPT_*_fake above. | |
eac8f358 KZ |
105 | |
106 | ||
107 | External services | |
108 | ----------------- | |
109 | ||
110 | Travis CI - automatically executed for all github commits. | |
111 | ||
112 | URL: https://travis-ci.org/karelzak/util-linux/ | |
113 | ||
114 | See .travis.yml for more details. | |
115 | ||
116 | We require "sudo" to install additional stuff and to run the tests with | |
117 | UID=0, it means that tests are executed on travis "legacy infrastructure". | |
118 | ||
119 | ||
268a62bf | 120 | Drone.io - automatically executed for all github commits. |
eac8f358 KZ |
121 | |
122 | URL: https://drone.io/github.com/karelzak/util-linux | |
123 | ||
124 | The drone.io does not use any in-tree config file (like travis-ci), the | |
268a62bf | 125 | currently used configuration (maintained by Drone.io web UI): |
eac8f358 KZ |
126 | |
127 | MAKE_CHECK="root" | |
128 | MAKE_CHECK_OPTS="--skip-loopdevs --exclude=mount/move" | |
129 | source ./.travis-functions.sh | |
130 | travis_install_script || exit | |
131 | travis_before_script || exit | |
132 | ret=0 | |
133 | travis_script || ret=$? | |
134 | travis_after_script | |
135 | exit $ret | |
136 | ||
137 | yes, it shares the setup functions with travis-ci. |