@@ -18,3 +18,4 @@ set(CORELIBS ${THREAD_LIBRARY} ${CURSES_LIBRARY})
add_library(profiler SHARED ${common_sources})
target_link_libraries( profiler ${CMAKE_THREAD_LIBS_INIT} ${CORELIBS} )
+add_subdirectory(test)
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,13 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(ProfilerTest C CXX)
+
+SET(CC_COVERAGE_COMPILE_FLAGS "-fPIC")
+SET(CC_COVERAGE_LINK_FLAGS "")
+
+add_compile_options(-g)
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
+add_compile_options(-finstrument-functions)
+
+add_executable(profilerTest profilerTest.cpp)
+
+target_link_libraries(profilerTest PUBLIC libace_napi.z.so profiler)
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <iostream>
+
+void funcTest1() {
+ sleep(5);
+}
+
+void funcTest2() {
+ sleep(3);
+ funcTest1();
+}
+
+void funcTest3() {
+ sleep(3);
+}
+
+int main() {
+ funcTest1();
+ funcTest2();
+ funcTest3();
+ return 0;
+}