Commit 5242f454 authored by Francois Bleibel's avatar Francois Bleibel
Browse files

Separated unit tests and tools. Added ADD_TEST cmake command.

parent 0fd5ded5
......@@ -98,8 +98,11 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dynamic-graph.pc
DESTINATION ${install_libdir_pkgconfig}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
ENABLE_TESTING()
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(unitTesting)
#
......
#
# Copyright
#
### tools
SET(tools
test_shell
)
FOREACH(tool_name ${tools})
SET(EXECUTABLE_NAME ${tool_name})
ADD_DEFINITIONS(-DDEBUG=2)
ADD_EXECUTABLE(${EXECUTABLE_NAME}
${tool_name}.cpp)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/../include
)
LINK_DIRECTORIES(${${PROJECT_NAME}_BINARY_DIR}/lib)
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME}
${PROJECT_NAME}
dl)
INSTALL(TARGETS ${tool_name}
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME})
ENDFOREACH(tool_name)
\ No newline at end of file
......@@ -4,7 +4,6 @@
### tests
SET(tests
test_shell
test_pool
test_depend
test_signalcast)
......@@ -27,6 +26,5 @@ FOREACH(test_name ${tests})
${PROJECT_NAME}
dl)
INSTALL(TARGETS ${test_name}
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME})
ADD_TEST(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
\ No newline at end of file
......@@ -37,13 +37,15 @@
using namespace std;
using namespace dynamicgraph;
main() {
Signal<int, int> mySignal("out");
istringstream value("5");
int main() {
Signal<double, int> mySignal("out");
istringstream value("42.0");
cout << "[cast] Setting signal value to " << value.str() << endl;
mySignal.set(value); // use "set" operation
cout << "[disp] The value read is ";
mySignal.get(cout);
cout << "[trace] Printing out trace: ";
mySignal.trace(cout);
return 0;
}
Supports Markdown
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