Add unit tests for emu and emu_trace
This commit is contained in:
parent
aafc3471cc
commit
b3e6c21b7c
@ -3,20 +3,27 @@
|
|||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
"${CMAKE_SOURCE_DIR}/src/include"
|
"${CMAKE_SOURCE_DIR}/src/include"
|
||||||
|
"${CMAKE_SOURCE_DIR}/src/emu"
|
||||||
"${CMAKE_SOURCE_DIR}/src"
|
"${CMAKE_SOURCE_DIR}/src"
|
||||||
"${CMAKE_SOURCE_DIR}/include"
|
"${CMAKE_SOURCE_DIR}/include"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(trace STATIC trace.c)
|
#add_library(trace STATIC trace.c)
|
||||||
target_link_libraries(trace parson ovni-static)
|
#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
|
chan.c
|
||||||
bay.c
|
bay.c
|
||||||
mux.c
|
mux.c
|
||||||
prv.c
|
prv.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_subdirectory(ovni)
|
||||||
|
|
||||||
#add_library(emu STATIC
|
#add_library(emu STATIC
|
||||||
# chan.c
|
# chan.c
|
||||||
# emu.c
|
# emu.c
|
||||||
|
@ -14,3 +14,6 @@ unit_test(bay-hash-speed.c)
|
|||||||
unit_test(mux.c)
|
unit_test(mux.c)
|
||||||
unit_test(value.c)
|
unit_test(value.c)
|
||||||
unit_test(prv.c)
|
unit_test(prv.c)
|
||||||
|
#unit_test(ovni_model.c)
|
||||||
|
unit_test(emu_trace.c)
|
||||||
|
unit_test(emu.c)
|
||||||
|
20
test/unit/emu.c
Normal file
20
test/unit/emu.c
Normal file
@ -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;
|
||||||
|
}
|
14
test/unit/emu_trace.c
Normal file
14
test/unit/emu_trace.c
Normal file
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user