Skip to content
Snippets Groups Projects
Commit d15c41be authored by Martin Killenberg's avatar Martin Killenberg
Browse files

made config file to depend on the application name, and fixed execution code...

made config file to depend on the application name, and fixed execution code for the tests by gracefully quitting the doocs server thread
parent 9a4eae8f
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
#include <sys/stat.h>
char const *object_name;
static char const * DOOCS_VARIABLE_CONFIG_FILE = "DoocsVariableConfig.xml";
static char const * XML_CONFIG_SUFFIX = "-DoocsVariableConfig.xml";
static ChimeraTK::DoocsAdapter doocsAdapter;
......@@ -23,14 +23,16 @@ void eq_init_prolog() {
// the variable manager can only be filled after we have the CS manager
auto pvNames = ChimeraTK::getAllVariableNames( doocsAdapter.getControlSystemPVManager() );
auto xmlFileName = ChimeraTK::ApplicationBase::getInstance().getName()+XML_CONFIG_SUFFIX;
struct stat buffer;
if (stat (DOOCS_VARIABLE_CONFIG_FILE, &buffer) == 0){
ChimeraTK::VariableMapper::getInstance().prepareOutput(DOOCS_VARIABLE_CONFIG_FILE, pvNames);
if (stat (xmlFileName.c_str(), &buffer) == 0){
ChimeraTK::VariableMapper::getInstance().prepareOutput(xmlFileName, pvNames);
}else{
std::cerr << "WARNIUNG: No XML file for the Doocs variable config found. Trying direct import." << std::endl;
ChimeraTK::VariableMapper::getInstance().directImport(pvNames);
}
std::cout << "here is the mappging:" << std::endl;
std::cout << "here is the mapping:" << std::endl;
for (auto &tmp : ChimeraTK::VariableMapper::getInstance().getAllProperties() ){
std::cout << tmp.first << " -> " << tmp.second->location << " / " << tmp.second->name << std::endl;
}
......
......@@ -52,8 +52,9 @@ public:
add( BOOST_TEST_CASE( &testVariableExistence ) );
}
~PlainVariableCreationTestSuite(){
// shut down the doocs server correctly
DoocsServerTestHelper::shutdown();
// gracefully shut down the doocs server and wait for the thread to join
std::cout << "FIXME: I think you can ignore the folloging 'write_line' warning when stopping the doocs server" << std::endl;
DoocsServerTestHelper::doocsSet("//PLAIN_VARIABLE_CREATION_TEST._SVR/SVR.STOP_SVR",true);
doocsServerThread.join();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment