summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPovilas Kanapickas <povilas@radix.lt>2021-02-08 02:39:04 +0200
committerPovilas Kanapickas <povilas@radix.lt>2021-02-08 02:39:04 +0200
commita8264cbbd94c70d0a3a3887d522a73c5be4a3912 (patch)
tree7674968c2b16baf098a16ff590740530446cef6b
parent1fb6ba1a4f0743b77abbcb676b358563cd899c99 (diff)
README: Document how to run tests in isolated environment
-rw-r--r--README.md25
1 files changed, 21 insertions, 4 deletions
diff --git a/README.md b/README.md
index cd9889f..ce91c7c 100644
--- a/README.md
+++ b/README.md
@@ -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