2014-03-28 20:00:23 +00:00
|
|
|
#include <stdlib.h>
|
2014-04-13 00:15:18 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
2014-10-22 19:46:51 +00:00
|
|
|
#include <string.h>
|
2014-03-28 20:00:23 +00:00
|
|
|
#include <assert.h>
|
2014-04-13 00:15:18 +00:00
|
|
|
#include <bemenu.h>
|
2014-03-28 20:00:23 +00:00
|
|
|
|
2014-10-22 19:46:51 +00:00
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
2014-03-28 20:00:23 +00:00
|
|
|
{
|
|
|
|
(void)argc, (void)argv;
|
|
|
|
|
2014-10-22 19:46:51 +00:00
|
|
|
if (!bm_init())
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
2014-03-28 20:00:23 +00:00
|
|
|
// TEST: Instance bmMenu with all possible draw modes.
|
|
|
|
{
|
2014-10-22 19:46:51 +00:00
|
|
|
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)) {
|
2014-04-13 00:15:18 +00:00
|
|
|
printf("Skipping test for mode BM_DRAW_MODE_CURSES, as not running on terminal.\n");
|
|
|
|
continue;
|
|
|
|
}
|
2014-10-22 19:46:51 +00:00
|
|
|
struct bm_menu *menu = bm_menu_new(bm_renderer_get_name(renderers[i]));
|
2014-04-09 22:41:32 +00:00
|
|
|
assert(menu);
|
2014-10-22 19:46:51 +00:00
|
|
|
bm_menu_render(menu);
|
|
|
|
bm_menu_free(menu);
|
2014-03-28 20:00:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vim: set ts=8 sw=4 tw=0 :*/
|