player: remove unittest option

Since meson has its own unit testing system, let's rework mpv's tests so
they integrate nicely with this. To prepare for this, start off by
dropping the unittest option. Of course, this means that tests will no
longer be supported in the waf build at all but it will be dropped
anyway. Note that the tests option is preserved for the meson build. We
will still make use of this in the future commits.
This commit is contained in:
Dudemanguy 2023-02-24 16:24:49 -06:00
parent 3eae9d6c0f
commit 3535e326dc
9 changed files with 4 additions and 68 deletions

View File

@ -7166,21 +7166,3 @@ Miscellaneous
code is the same.) code is the same.)
Conversion is not applied to metadata that is updated at runtime. Conversion is not applied to metadata that is updated at runtime.
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.

View File

@ -25,7 +25,7 @@ if [ "$1" = "meson" ]; then
meson compile -C build meson compile -C build
cp ./build/generated/mpv.com ./build cp ./build/generated/mpv.com ./build
meson test -C build meson test -C build
./build/mpv.com --no-config -v --unittest=all-simple ./build/mpv.com -v --no-config
fi fi
if [ "$1" = "waf" ]; then if [ "$1" = "waf" ]; then
@ -53,5 +53,5 @@ if [ "$1" = "waf" ]; then
--lua=luajit \ --lua=luajit \
--enable-vulkan --enable-vulkan
./waf build ./waf build
./build_waf/mpv.com -v --no-config -v --unittest=all-simple ./build_waf/mpv.com -v --no-config
fi fi

View File

@ -15,7 +15,7 @@ if [ "$1" = "meson" ]; then
-Dvulkan=enabled -Dvulkan=enabled
meson compile -C build meson compile -C build
meson test -C build meson test -C build
./build/mpv --no-config -v --unittest=all-simple ./build/mpv -v --no-config
fi fi
if [ "$1" = "waf" ]; then if [ "$1" = "waf" ]; then
@ -32,5 +32,5 @@ if [ "$1" = "waf" ]; then
--enable-tests \ --enable-tests \
--enable-vulkan --enable-vulkan
python3 ./waf build python3 ./waf build
./build_waf/mpv -v --no-config -v --unittest=all-simple ./build_waf/mpv -v --no-config
fi fi

View File

@ -342,19 +342,6 @@ if features['cplugins']
link_flags += '-rdynamic' link_flags += '-rdynamic'
endif endif
features += {'tests': get_option('tests')}
if features['tests']
sources += files('test/chmap.c',
'test/gl_video.c',
'test/img_format.c',
'test/json.c',
'test/linked_list.c',
'test/paths.c',
'test/scale_sws.c',
'test/scale_test.c',
'test/tests.c')
endif
# Note: this include is only used for windows pthreads and # Note: this include is only used for windows pthreads and
# must be accompanied immediately by the following flags. # must be accompanied immediately by the following flags.
# This currently works because these are the last flags set # This currently works because these are the last flags set
@ -752,10 +739,6 @@ if features['zimg']
dependencies += zimg dependencies += zimg
sources += files('video/filter/vf_fingerprint.c', sources += files('video/filter/vf_fingerprint.c',
'video/zimg.c') 'video/zimg.c')
if features['tests']
sources += files('test/repack.c',
'test/scale_zimg.c')
endif
features += {'zimg-st428': zimg.version().version_compare('>= 3.0.5')} features += {'zimg-st428': zimg.version().version_compare('>= 3.0.5')}
endif endif

View File

@ -403,10 +403,6 @@ static const m_option_t mp_opts[] = {
{"version", OPT_PRINT(print_version)}, {"version", OPT_PRINT(print_version)},
{"V", OPT_PRINT(print_version)}, {"V", OPT_PRINT(print_version)},
#if HAVE_TESTS
{"unittest", OPT_STRING(test_mode), .flags = CONF_NOCFG | M_OPT_NOPROP},
#endif
{"player-operation-mode", OPT_CHOICE(operation_mode, {"player-operation-mode", OPT_CHOICE(operation_mode,
{"cplayer", 0}, {"pseudo-gui", 1}), {"cplayer", 0}, {"pseudo-gui", 1}),
.flags = M_OPT_PRE_PARSE | M_OPT_NOPROP}, .flags = M_OPT_PRE_PARSE | M_OPT_NOPROP},

View File

@ -145,7 +145,6 @@ typedef struct MPOpts {
bool msg_time; bool msg_time;
char *log_file; char *log_file;
char *test_mode;
int operation_mode; int operation_mode;
char **reset_options; char **reset_options;

View File

@ -61,7 +61,6 @@
#include "audio/out/ao.h" #include "audio/out/ao.h"
#include "misc/thread_tools.h" #include "misc/thread_tools.h"
#include "sub/osd.h" #include "sub/osd.h"
#include "test/tests.h"
#include "video/out/vo.h" #include "video/out/vo.h"
#include "core.h" #include "core.h"
@ -385,11 +384,6 @@ int mp_initialize(struct MPContext *mpctx, char **options)
check_library_versions(mp_null_log, 0); check_library_versions(mp_null_log, 0);
#if HAVE_TESTS
if (opts->test_mode && opts->test_mode[0])
return run_tests(mpctx) ? 1 : -1;
#endif
if (!mpctx->playlist->num_entries && !opts->player_idle_mode && if (!mpctx->playlist->num_entries && !opts->player_idle_mode &&
options) options)
{ {

View File

@ -78,11 +78,6 @@ build_options = [
'desc': 'whether to compile-in debugging information', 'desc': 'whether to compile-in debugging information',
'default': 'enable', 'default': 'enable',
'func': check_true 'func': check_true
}, {
'name': '--tests',
'desc': 'unit tests (development only)',
'default': 'disable',
'func': check_true
}, { }, {
# Reminder: normally always built, but enabled by MPV_LEAK_REPORT. # Reminder: normally always built, but enabled by MPV_LEAK_REPORT.
# Building it can be disabled only by defining NDEBUG through CFLAGS. # Building it can be disabled only by defining NDEBUG through CFLAGS.

View File

@ -424,19 +424,6 @@ def build(ctx):
( "sub/sd_ass.c" ), ( "sub/sd_ass.c" ),
( "sub/sd_lavc.c" ), ( "sub/sd_lavc.c" ),
## Tests
( "test/chmap.c", "tests" ),
( "test/gl_video.c", "tests" ),
( "test/img_format.c", "tests" ),
( "test/json.c", "tests" ),
( "test/linked_list.c", "tests" ),
( "test/paths.c", "tests" ),
( "test/repack.c", "tests && zimg" ),
( "test/scale_sws.c", "tests" ),
( "test/scale_test.c", "tests" ),
( "test/scale_zimg.c", "tests && zimg" ),
( "test/tests.c", "tests" ),
## Video ## Video
( "video/csputils.c" ), ( "video/csputils.c" ),
( "video/cuda.c", "cuda-hwaccel" ), ( "video/cuda.c", "cuda-hwaccel" ),