Commit 960dfdc3 authored by Hanspeter Portner's avatar Hanspeter Portner

prototype unit testing of API.

parent 08e82749
......@@ -15,4 +15,4 @@ install:
before_script:
- mkdir build && pushd build && cmake -DCMAKE_C_FLAGS="-std=gnu99" .. && popd
script:
- pushd build && make && sudo make install && popd
- pushd build && make && sudo make install; ./test_moony && popd
......@@ -120,3 +120,54 @@ install(TARGETS moony_ui DESTINATION ${DEST})
configure_file(${PROJECT_SOURCE_DIR}/manifest.ttl.in ${PROJECT_BINARY_DIR}/manifest.ttl)
install(FILES ${PROJECT_BINARY_DIR}/manifest.ttl DESTINATION ${DEST})
install(FILES ${PROJECT_SOURCE_DIR}/moony.ttl DESTINATION ${DEST})
option(BUILD_TEST "Build test app" OFF)
add_executable(test_moony
test_moony.c
api.c
vm.c
tlsf-3.0/tlsf.c
lua-5.3/lapi.c
lua-5.3/lcode.c
lua-5.3/lctype.c
lua-5.3/ldebug.c
lua-5.3/ldo.c
lua-5.3/ldump.c
lua-5.3/lfunc.c
lua-5.3/lgc.c
lua-5.3/llex.c
lua-5.3/lmem.c
lua-5.3/lobject.c
lua-5.3/lopcodes.c
lua-5.3/lparser.c
lua-5.3/lstate.c
lua-5.3/lstring.c
lua-5.3/ltable.c
lua-5.3/ltm.c
lua-5.3/lundump.c
lua-5.3/lvm.c
lua-5.3/lzio.c
lua-5.3/lbaselib.c
lua-5.3/lauxlib.c
lua-5.3/lcorolib.c
lua-5.3/lmathlib.c
lua-5.3/lstrlib.c
lua-5.3/ltablib.c
lua-5.3/lutf8lib.c)
#lua-5.3/lbitlib.c
#lua-5.3/ldblib.c
#lua-5.3/liolib.c
#lua-5.3/loslib.c
#lua-5.3/loadlib.c
#lua-5.3/linit.c
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_compile_definitions(test_moony PUBLIC -DLUA_USE_LINUX)
elseif(WIN32)
target_compile_definitions(test_moony PUBLIC)
elseif(APPLE)
target_compile_definitions(test_moony PUBLIC -DLUA_USE_MACOSX)
endif()
target_link_libraries(test_moony ${LIBS} "-lm")
/*
* Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the Artistic License 2.0 as published by
* The Perl Foundation.
*
* This source is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Artistic License 2.0 for more details.
*
* You should have received a copy of the Artistic License 2.0
* along the source as a COPYING file. If not, obtain it from
* http://www.perlfoundation.org/artistic_license_2_0.
*/
#include <moony.h>
typedef struct _Handle Handle;
struct _Handle {
moony_t moony;
int max_val;
const LV2_Atom_Sequence *event_in;
LV2_Atom_Sequence *event_out;
const float *val_in [4];
float *val_out [4];
const LV2_Atom_Sequence *control;
LV2_Atom_Sequence *notify;
LV2_Atom_Forge forge;
};
int
main(int argc, char **argv)
{
Handle *producer = calloc(1, sizeof(Handle));
Handle *consumer = calloc(1, sizeof(Handle));
if(!producer || !consumer)
{
if(producer)
free(producer);
if(consumer)
free(consumer);
return -1;
}
//TODO write test cases
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment