Commit 95eea1d2 authored by nfoy's avatar nfoy

Merge branch 'wip-nfoy-add-test-tcptagging' into integration-1.2

parents 93de4125 152849e1
......@@ -7,7 +7,7 @@ SET(source_files "${source_files};${additional_source_files}")
SET(ADDITIONAL_PATH "${CMAKE_SOURCE_DIR}/contrib/plugins/server-extensions/tcp-tagging/")
INCLUDE_DIRECTORIES(${ADDITIONAL_PATH})
FILE(GLOB_RECURSE additional_source_files ${ADDITIONAL_PATH}/*.cpp ${ADDITIONAL_PATH}/*.h)
FILE(GLOB additional_source_files ${ADDITIONAL_PATH}/*.cpp ${ADDITIONAL_PATH}/*.h)
SET(source_files "${source_files};${additional_source_files}")
FUNCTION(OV_ADD_CONTRIB_DRIVER DRIVER_PATH)
......@@ -62,3 +62,6 @@ IF(WIN32)
ENDIF(PATH_EEGOAPI)
ENDIF(WIN32)
IF(OV_COMPILE_TESTS)
ADD_SUBDIRECTORY("../../../contrib/plugins/server-extensions/tcp-tagging/test" "./test")
ENDIF(OV_COMPILE_TESTS)
#ifndef __OpenViBE_AcquisitionServer_TCPTagSession_H__
#define __OpenViBE_AcquisitionServer_TCPTagSession_H__
#ifndef __OpenViBE_AcquisitionServer_TCPTagStream_H__
#define __OpenViBE_AcquisitionServer_TCPTagStream_H__
#include <queue>
#include <boost/bind.hpp>
......@@ -126,4 +126,4 @@ private:
}
#endif // __OpenViBE_AcquisitionServer_TCPTagSession_H__
#endif // __OpenViBE_AcquisitionServer_TCPTagStream_H__
PROJECT(test_tagstream)
IF(WIN32)
ADD_DEFINITIONS(-DTARGET_OS_Windows)
ENDIF(WIN32)
IF(UNIX)
ADD_DEFINITIONS(-DTARGET_OS_Linux)
ENDIF(UNIX)
INCLUDE_DIRECTORIES(../)
ADD_EXECUTABLE(${PROJECT_NAME} test_tagstream.cpp ../ovasCTagStream.cpp)
INCLUDE("FindOpenViBE")
INCLUDE("FindThirdPartyBoost_System")
INCLUDE("FindThirdPartyBoost_Thread")
# Unfortunately we need to install the tests as any application to find .dll/.so files
# on both Windows and Linux.
OV_INSTALL_LAUNCH_SCRIPT(${PROJECT_NAME})
INSTALL(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
# Basic Template Test for automatic run a scenario that produce a file to be compared to a reference file
# You need to set the name of the test according to name of scenario file and reference file
# Test TagStream
SET(TEST_NAME "TagStream")
IF(WIN32)
SET(EXT cmd)
SET(OS_FLAGS "--no-pause")
ELSE(WIN32)
SET(EXT sh)
SET(OS_FLAGS "")
ENDIF(WIN32)
ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/test_tagstream.${EXT}" ${OS_FLAGS})
#include "../ovasCTagStream.h"
using namespace OpenViBEAcquisitionServer;
using namespace OpenViBEAcquisitionServerPlugins;
int main()
{
bool ok=false;
CTagStream tagStream1;
try {
// The construction of the second TagStream must fail because of port already in use.
CTagStream tagStream2;
}
catch(std::exception &e) {
ok=true;
}
// The construction must succeed because another port is used.
CTagStream tagStream3(15362);
if (!ok)
return 1;
return 0;
}
......@@ -49,6 +49,7 @@ foreach (_variableName ${_variableNames})
endforeach()
SUBDIRS("${CTEST_SOURCE_DIRECTORY}/contrib/plugins/server-extensions/tcp-tagging/test")
SUBDIRS("${CTEST_SOURCE_DIRECTORY}/plugins/processing/acquisition/test")
SUBDIRS("${CTEST_SOURCE_DIRECTORY}/plugins/processing/turbofieldtrip/test")
SUBDIRS("${CTEST_SOURCE_DIRECTORY}/plugins/processing/tools/test")
......
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