summaryrefslogtreecommitdiffstats
path: root/test/index.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-08 14:21:40 +0100
committerwm4 <wm4@nowhere>2019-11-08 14:21:40 +0100
commit3ed9c1c9701098db17a2b791f9793e75a1947cc9 (patch)
tree4a1fb9145ab825c582e1e30fd819522d9aa0f93e /test/index.h
parent53b7a10f5453083390e65bdab5f1e642c37d89a2 (diff)
downloadmpv-3ed9c1c9701098db17a2b791f9793e75a1947cc9.tar.bz2
mpv-3ed9c1c9701098db17a2b791f9793e75a1947cc9.tar.xz
test: just always provide a context for all entrypoints
Diffstat (limited to 'test/index.h')
-rw-r--r--test/index.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/index.h b/test/index.h
index 6060eb699f..1564fe311a 100644
--- a/test/index.h
+++ b/test/index.h
@@ -2,25 +2,28 @@
#include <stdbool.h>
-struct mpv_global;
-struct mp_log;
struct MPContext;
bool run_tests(struct MPContext *mpctx);
+struct test_ctx {
+ struct mpv_global *global;
+ struct mp_log *log;
+};
+
struct unittest {
// This is used to select the test on command line with --unittest=<name>.
const char *name;
+ // Cannot run without additional arguments supplied.
+ bool is_complex;
+
// Entrypoints. There are various for various purposes. Only 1 of them must
// be set.
- // Entrypoint for tests which don't depend on the mpv core.
- void (*run_simple)(void);
-
// Entrypoint for tests which have a simple dependency on the mpv core. The
// core is sufficiently initialized at this point.
- void (*run)(struct mpv_global *global, struct mp_log *log);
+ void (*run)(struct test_ctx *ctx);
};
extern const struct unittest test_chmap;