aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-runner.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-03-02 18:03:16 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-03-02 18:05:33 -0500
commit62d25699540a71aa42f6414cd51cedfb8d3a3392 (patch)
treee80d80afbb73656c4f598366f5424eb556167eee /tests/test-runner.h
parentTerminate drag if data source is destroyed (diff)
downloadwayland-62d25699540a71aa42f6414cd51cedfb8d3a3392.tar
wayland-62d25699540a71aa42f6414cd51cedfb8d3a3392.tar.gz
wayland-62d25699540a71aa42f6414cd51cedfb8d3a3392.tar.bz2
wayland-62d25699540a71aa42f6414cd51cedfb8d3a3392.tar.lz
wayland-62d25699540a71aa42f6414cd51cedfb8d3a3392.tar.xz
wayland-62d25699540a71aa42f6414cd51cedfb8d3a3392.tar.zst
wayland-62d25699540a71aa42f6414cd51cedfb8d3a3392.zip
tests: Add Unit tests for wl_map and wl_array data structures
We use a simple test-runner helper that runs each test in a separate process and reports the pass/fail rate at the end.
Diffstat (limited to 'tests/test-runner.h')
-rw-r--r--tests/test-runner.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-runner.h b/tests/test-runner.h
new file mode 100644
index 0000000..c1fdff9
--- /dev/null
+++ b/tests/test-runner.h
@@ -0,0 +1,14 @@
+struct test {
+ const char *name;
+ void (*run)(void);
+};
+
+#define TEST(name) \
+ static void name(void); \
+ \
+ const struct test test##name \
+ __attribute__ ((section ("test_section"))) = { \
+ #name, name \
+ }; \
+ \
+ static void name(void)