mirror of
https://github.com/Cloudef/bemenu
synced 2024-09-24 13:01:30 +02:00
Add tests.
This commit is contained in:
parent
06c8bde93f
commit
17250cfd3f
@ -1,5 +1,17 @@
|
||||
INCLUDE(CTest)
|
||||
SET(TESTS
|
||||
"bmMenuNew"
|
||||
)
|
||||
|
||||
# TODO: write test CMakeLists
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../lib")
|
||||
FOREACH (test ${TESTS})
|
||||
ADD_EXECUTABLE(${test}_test ${test}.c)
|
||||
TARGET_LINK_LIBRARIES(${test}_test bemenu)
|
||||
|
||||
IF (WIN32)
|
||||
ADD_TEST(${test}_test ${test}_test.exe)
|
||||
ELSE ()
|
||||
ADD_TEST(${test}_test ${test}_test)
|
||||
ENDIF ()
|
||||
ENDFOREACH (test)
|
||||
|
||||
# vim: set ts=8 sw=4 tw=0 :
|
||||
|
23
test/bmMenuNew.c
Normal file
23
test/bmMenuNew.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdlib.h>
|
||||
#include <bemenu.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void)argc, (void)argv;
|
||||
|
||||
// TEST: Instance bmMenu with all possible draw modes.
|
||||
{
|
||||
bmDrawMode i;
|
||||
for (i = 0; i < BM_DRAW_MODE_LAST; ++i) {
|
||||
bmMenu *menu = bmMenuNew(BM_DRAW_MODE_NONE);
|
||||
assert(menu != NULL);
|
||||
bmMenuRender(menu);
|
||||
bmMenuFree(menu);
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/* vim: set ts=8 sw=4 tw=0 :*/
|
Loading…
Reference in New Issue
Block a user