summaryrefslogtreecommitdiffstats
path: root/DOCS/man/options.rst
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-07 22:42:14 +0100
committerwm4 <wm4@nowhere>2019-11-08 00:26:37 +0100
commitfb568963199312c7970ebc3bd7f89ae85ea43648 (patch)
treecac54fb7ff53e2aeda9281f132823df5e7245dfa /DOCS/man/options.rst
parent17dde8eeb6516b8000248c3bcce293d695232865 (diff)
downloadmpv-fb568963199312c7970ebc3bd7f89ae85ea43648.tar.bz2
mpv-fb568963199312c7970ebc3bd7f89ae85ea43648.tar.xz
test: make tests part of the mpv binary
Until now, each .c file in test/ was built as separate, self-contained binary. Each binary could be run to execute the tests it contained. Change this and make them part of the normal mpv binary. Now the tests have to be invoked via the --unittest option. Do this for two reasons: - Tests now run within a "properly" initialized mpv instance, so all services are available. - Possibly simplifying the situation for future build systems. The first point is the main motivation. The mpv code is entangled with mp_log and the option system. It feels like a bad idea to duplicate some of the initialization of this just so you can call code using them. I'm also getting rid of cmocka. There wouldn't be any problem to keep it (it's a perfectly sane set of helpers), but NIH calls. I would have had to aggregate all tests into a CMUnitTest list, and I don't see how I'd get different types of entry points easily. Probably easily solvable, but since we made only pretty basic use of this library, NIH-ing this is actually easier (I needed a list of tests with custom metadata anyway, so all what was left was reimplement the assert_* helpers). Unit tests now don't output anything, and if they fail, they'll simply crash and leave a message that typically requires inspecting the test code to figure out what went wrong (and probably editing the test code to get more information). I even merged the various test functions into single ones. Sucks, but here you go. chmap_sel.c is merged into chmap.c, because I didn't see the point of this being separate. json.c drops the print_message() to go along with the new silent-by-default idea, also there's a memory leak fix unrelated to the rest of this commit. The new code is enabled with --enable-tests (--enable-test goes away). Due to waf's option parser, --enable-test still works, because it's a unique prefix to --enable-tests.
Diffstat (limited to 'DOCS/man/options.rst')
-rw-r--r--DOCS/man/options.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 27b24d0e98..4c208fe025 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -6184,3 +6184,20 @@ Miscellaneous
See the FFmpeg libavfilter documentation for details on the available
filters.
+
+Debugging
+---------
+
+``--unittest=<name>``
+ Run an internal unit test. There are multiple, and the name specifies which.
+
+ The special value ``all-simple`` runs all tests which do not need further
+ setup (other arguments and such). Some tests may need additional arguments
+ to do anything useful.
+
+ On success, the player binary exits with exit status 0, otherwise it returns
+ with an undefined non-0 exit status (it may crash or abort itself on test
+ failures).
+
+ This is only enabled if built with ``--enable-tests``, and should normally
+ be enabled and used by developers only.