diff options
author | Povilas Kanapickas <povilas@radix.lt> | 2021-02-08 02:39:04 +0200 |
---|---|---|
committer | Povilas Kanapickas <povilas@radix.lt> | 2021-02-08 02:39:04 +0200 |
commit | a8264cbbd94c70d0a3a3887d522a73c5be4a3912 (patch) | |
tree | 7674968c2b16baf098a16ff590740530446cef6b | |
parent | 1fb6ba1a4f0743b77abbcb676b358563cd899c99 (diff) |
README: Document how to run tests in isolated environment
-rw-r--r-- | README.md | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -15,10 +15,27 @@ Running the tests Tests can be run by `ninja -C builddir test`, or one-by-one. -Most tests start up some X server, so it is advisable to shut down any X -server on the test box. Some tests only start Xdummy, but do add -virtual input devices that may mess with the current session. Again, it is -advisable to shut down any X server on the test box. +All tests except the input and video module load tests can be run inside a container. +This allows to run the tests in a regular development machine with convenient debugging +and fast turnaround. The only prerequisite is root permissions. + +The most convenient way to run the tests is doing the following as root: + +``` +$ unshare --ipc --mount --mount-proc --net --pid --fork /bin/bash + # then, in the newly opened shell session, perform the following +$ mkdir -p empty +$ mount --bind empty /dev +$ mount --bind empty /sys + # now the tests can be run +``` + +This creates a bare-bones environment that shares the filesystem with the rest of the system, +but is otherwise isolated from it. This allows running additional X servers without affecting the +primary X server running on the machine. + +If the tests are run without any isolation then it is advisable to shut down any X +server on the test box. For controlling test output (e.g. xml reporting), refer to http://code.google.com/p/googletest/wiki/AdvancedGuide#Controlling_Test_Output |