diff --git a/src/emu/CMakeLists.txt b/src/emu/CMakeLists.txt index 4c2da7f..88b0cf2 100644 --- a/src/emu/CMakeLists.txt +++ b/src/emu/CMakeLists.txt @@ -3,20 +3,27 @@ include_directories( "${CMAKE_SOURCE_DIR}/src/include" + "${CMAKE_SOURCE_DIR}/src/emu" "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/include" ) -add_library(trace STATIC trace.c) -target_link_libraries(trace parson ovni-static) +#add_library(trace STATIC trace.c) +#target_link_libraries(trace parson ovni-static) -add_library(chan STATIC +add_library(emu STATIC + emu.c + emu_stream.c + emu_trace.c + emu_system.c chan.c bay.c mux.c prv.c ) +add_subdirectory(ovni) + #add_library(emu STATIC # chan.c # emu.c diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 4d99bd7..b41c2dc 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -14,3 +14,6 @@ unit_test(bay-hash-speed.c) unit_test(mux.c) unit_test(value.c) unit_test(prv.c) +#unit_test(ovni_model.c) +unit_test(emu_trace.c) +unit_test(emu.c) diff --git a/test/unit/emu.c b/test/unit/emu.c new file mode 100644 index 0000000..d5dcfb4 --- /dev/null +++ b/test/unit/emu.c @@ -0,0 +1,20 @@ +#include "emu/emu.h" +#include "common.h" + +int main(void) +{ + char *argv[] = { + "ovniemu", + "/home/ram/bsc/ovni/traces/test/ovni", + NULL + }; + + int argc = 2; + + struct emu emu; + + if (emu_init(&emu, argc, argv) != 0) + die("emu_init failed\n"); + + return 0; +} diff --git a/test/unit/emu_trace.c b/test/unit/emu_trace.c new file mode 100644 index 0000000..99586f3 --- /dev/null +++ b/test/unit/emu_trace.c @@ -0,0 +1,14 @@ +#include "emu/emu_trace.h" +#include "common.h" + +int main(void) +{ + char *tracedir = "/home/ram/bsc/ovni/traces/test/ovni"; + + struct emu_trace trace; + + if (emu_trace_load(&trace, tracedir) != 0) + die("emu_trace_load failed\n"); + + return 0; +}