Commit 50b42521 authored by Serrière Guillaume's avatar Serrière Guillaume

Add configuration file for test.

Signed-off-by: default avatarSerrière Guillaume <guillaume.serriere@inria.fr>
parent bd2a63b3
......@@ -778,6 +778,7 @@ void CApplication::initialize(ECommandLineFlag eCommandLineFlags)
m_pResourceNotebook=GTK_NOTEBOOK(gtk_builder_get_object(m_pBuilderInterface, "openvibe-resource_notebook"));
m_pInitAlert = GTK_TOGGLE_BUTTON(gtk_builder_get_object(m_pBuilderInterface, "openvibe-messages_init_alert"));
gtk_toggle_button_set_active(m_pInitAlert, (OpenViBE::boolean)(m_rKernelContext.getConfigurationManager().expandAsBoolean("${Designer_PopUpOnInitError}")));
// Creates an empty scnenario
gtk_notebook_remove_page(m_pScenarioNotebook, 0);
......@@ -1913,7 +1914,7 @@ OpenViBE::boolean CApplication::createPlayer(void)
}
else{
m_rKernelContext.getLogManager() << LogLevel_Error << "Initilization of scenario didn't work properly."
" Aborting the execution. (To prevent this, deactivate the warning on initialization option\n" ;
" Aborting the execution. (To prevent this, deactivate the warning on initialization option)\n" ;
res=0;//No matter what happen, if the user ask for a warning on initilization we consider that we don't run the scenario
}
}
......@@ -2102,7 +2103,7 @@ void CApplication::nextScenarioCB(void)
}
}
void CApplication::playScenarioCB(void)
boolean CApplication::playScenarioCB(void)
{
boolean l_bIsAlreadyStarted = false;
m_rKernelContext.getLogManager() << LogLevel_Trace << "playScenarioCB\n";
......@@ -2112,7 +2113,7 @@ void CApplication::playScenarioCB(void)
if(!this->createPlayer())
{
m_rKernelContext.getLogManager() << LogLevel_Error << "CreatePlayer failed\n";
return;
return false;
}
}
else
......@@ -2151,10 +2152,10 @@ void CApplication::playScenarioCB(void)
}
}
return true;
}
void CApplication::forwardScenarioCB(void)
boolean CApplication::forwardScenarioCB(void)
{
boolean l_bIsAlreadyStarted = false;
m_rKernelContext.getLogManager() << LogLevel_Trace << "forwardScenarioCB\n";
......@@ -2164,7 +2165,7 @@ void CApplication::forwardScenarioCB(void)
if(!this->createPlayer())
{
m_rKernelContext.getLogManager() << LogLevel_Error << "CreatePlayer failed\n";
return;
return false;
}
}
else
......@@ -2203,6 +2204,7 @@ void CApplication::forwardScenarioCB(void)
}
}
return true;
}
void CApplication::keyPressEventCB(::GtkWidget* pWidget, ::GdkEventKey* pEvent)
......
......@@ -92,8 +92,8 @@ namespace OpenViBEDesigner
void stopScenarioCB(void);
void pauseScenarioCB(void);
void nextScenarioCB(void);
void playScenarioCB(void);
void forwardScenarioCB(void);
OpenViBE::boolean playScenarioCB(void);
OpenViBE::boolean forwardScenarioCB(void);
void keyPressEventCB(::GtkWidget* pWidget, ::GdkEventKey* pEvent);
......
......@@ -403,6 +403,7 @@ boolean parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
int go(int argc, char ** argv)
{
boolean errorWhileLoadingScenario = false;
/*
{ 0, 0, 0, 0 },
{ 0, 16383, 16383, 16383 },
......@@ -468,6 +469,7 @@ int go(int argc, char ** argv)
CKernelLoader l_oKernelLoader;
cout<<"[ INF ] Created kernel loader, trying to load kernel module"<<"\n";
CString l_sError;
#if defined TARGET_OS_Windows
......@@ -564,7 +566,6 @@ int go(int argc, char ** argv)
{
::CApplication app(*l_pKernelContext);
app.initialize(l_oConfiguration.getFlags());
// FIXME is it necessary to keep next line uncomment ?
//boolean l_bIsScreenValid=true;
if(!l_oConfiguration.m_eNoCheckColorDepth)
......@@ -587,10 +588,10 @@ int go(int argc, char ** argv)
}
}
}
std::map < ECommandLineFlag, std::string >::iterator it;
for(it=l_oConfiguration.m_oFlag.begin(); it!=l_oConfiguration.m_oFlag.end(); it++)
{
switch(it->first)
{
case CommandLineFlag_Open:
......@@ -601,14 +602,20 @@ int go(int argc, char ** argv)
l_rLogManager << LogLevel_Info << "Opening and playing scenario [" << CString(it->second.c_str()) << "]\n";
if(app.openScenario(it->second.c_str()))
{
app.playScenarioCB();
if(!app.playScenarioCB())
{
errorWhileLoadingScenario = true;
}
}
break;
case CommandLineFlag_PlayFast:
l_rLogManager << LogLevel_Info << "Opening and fast playing scenario [" << CString(it->second.c_str()) << "]\n";
if(app.openScenario(it->second.c_str()))
{
app.forwardScenarioCB();
if(!app.forwardScenarioCB())
{
errorWhileLoadingScenario = true;
}
}
break;
// case CommandLineFlag_Define:
......@@ -617,7 +624,6 @@ int go(int argc, char ** argv)
break;
}
}
if(app.m_vInterfacedScenario.empty())
{
app.newScenarioCB();
......@@ -656,6 +662,10 @@ int go(int argc, char ** argv)
l_oKernelLoader.uninitialize();
l_oKernelLoader.unload();
}
if(errorWhileLoadingScenario && l_oConfiguration.m_eNoGui == CommandLineFlag_NoGui)
{
return -1;
}
return 0;
}
......
......@@ -107,6 +107,7 @@ Designer_ScriptEditorCommand_Windows = notepad
Designer_ScriptEditorCommand_Linux = xdg-open
Designer_ScriptEditorCommand = ${Designer_ScriptEditorCommand_${OperatingSystem}}
Designer_PopUpOnError = false
Designer_PopUpOnInitError = false
Designer_AllowUpCastConnection = false
Designer_ConsoleLogWithHexa = false
Designer_ConsoleLogTimeInSecond = True
......
......@@ -135,7 +135,6 @@ EPlayerReturnCode CPlayer::initialize(void)
m_ui64CurrentTimeToReach=0;
m_ui64Lateness=0;
m_eStatus=PlayerStatus_Stop;
if(l_eCode == SchedulerInitialization_BoxInitializationFailed)
{
return PlayerReturnCode_BoxInitializationFailed;
......
......@@ -111,7 +111,6 @@ namespace OpenViBE
{
this->getLogManager() << LogLevel_Warning << "No 'plugin object descriptor' found from [" << CString(rEntry.getName()) << "] even if it looked like a plugin module\n";
}
return true;
}
......
......@@ -239,7 +239,6 @@ boolean CPluginModuleBase::getPluginObjectDescription(
rpPluginObjectDescription=NULL;
return false;
}
rpPluginObjectDescription=m_vPluginObjectDescriptor[ui32Index];
return true;
}
......
......@@ -19,7 +19,7 @@ FOREACH(TEST_NAME ${TEST_SCENARIOS})
SET(SCENARIO_TO_TEST "${TEST_NAME}.xml")
ADD_TEST(clean_${TEST_NAME} rm -f ${OV_LOGFILE} classifiers/multiclass.xml)
ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-gui" "--no-session-management" "--play-fast" ${SCENARIO_TO_TEST})
ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-gui" "--no-session-management" "--config" "$ENV{OV_BINARY_PATH}/share/openvibe/kernel/openvibe_test.conf" "--play-fast" ${SCENARIO_TO_TEST})
ADD_TEST(compare_${TEST_NAME} "$ENV{OV_BINARY_PATH}/test_accuracy.${EXT}" "${OS_FLAGS}" "${OV_LOGFILE}")
# It would be better to clean last, but we can't do this as it will delete the
......
......@@ -32,6 +32,7 @@ IF(NOT (LOCAL MATCHES "FALSE"))
message("running local test here= $ENV{OV_BINARY_PATH}")
SET(ENV{OV_DATA_PATH} "${OV_ROOT_DIR}/dist/share/openvibe/")
SET(ENV{OV_KERNEL_CONFIG_PATH "${OV_ROOT_DIR}/dist/share/openvibe/kernel")
IF(WIN32)
SET(ENV{OV_USERDATA} "$ENV{APPDATA}/openvibe/")
......
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