diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2014-10-22 22:46:51 +0300 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2014-10-22 22:46:51 +0300 |
commit | 014c20099d0199445cedc6e3504e4309176c56ae (patch) | |
tree | 2711398696489389cc9a48cf1789d7521767e054 /test/bm_menu_new.c | |
parent | 33aedfe23712ae99f3393b07567c49388fcba376 (diff) | |
download | bemenu-014c20099d0199445cedc6e3504e4309176c56ae.tar.gz bemenu-014c20099d0199445cedc6e3504e4309176c56ae.tar.bz2 bemenu-014c20099d0199445cedc6e3504e4309176c56ae.zip |
Refactor code to snake_style, turn renderers into plugins, and start
wayland (cairo) renderer.
Diffstat (limited to 'test/bm_menu_new.c')
-rw-r--r-- | test/bm_menu_new.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/bm_menu_new.c b/test/bm_menu_new.c new file mode 100644 index 0000000..ba9e20b --- /dev/null +++ b/test/bm_menu_new.c @@ -0,0 +1,35 @@ +#include <stdlib.h> +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <assert.h> +#include <bemenu.h> + +int +main(int argc, char **argv) +{ + (void)argc, (void)argv; + + if (!bm_init()) + return EXIT_FAILURE; + + // TEST: Instance bmMenu with all possible draw modes. + { + uint32_t count; + const struct bm_renderer **renderers = bm_get_renderers(&count); + for (int32_t i = 0; i < count; ++i) { + if (!strcmp(bm_renderer_get_name(renderers[i]), "curses") && !isatty(STDIN_FILENO)) { + printf("Skipping test for mode BM_DRAW_MODE_CURSES, as not running on terminal.\n"); + continue; + } + struct bm_menu *menu = bm_menu_new(bm_renderer_get_name(renderers[i])); + assert(menu); + bm_menu_render(menu); + bm_menu_render(menu); + } + } + + return EXIT_SUCCESS; +} + +/* vim: set ts=8 sw=4 tw=0 :*/ |