X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fyacsloader%2FTest%2FTestYacsLoader.cxx;h=cc9f87cfa9f94938214b6cf5c18a5ae7eee44a7a;hb=ff6426f394ecc496bfceee444f0fad78e955861e;hp=afa308c424a20fdabe449e329928a8fb9d0980e6;hpb=c43d1db1d5d3ba364f63a8a7c7ce4a58ea1c7d26;p=modules%2Fyacs.git diff --git a/src/yacsloader/Test/TestYacsLoader.cxx b/src/yacsloader/Test/TestYacsLoader.cxx index afa308c42..cc9f87cfa 100644 --- a/src/yacsloader/Test/TestYacsLoader.cxx +++ b/src/yacsloader/Test/TestYacsLoader.cxx @@ -20,6 +20,14 @@ #define UNIT_TEST_HEADER " --- TEST src/yacsloader" #include "YacsLoaderTest.hxx" +#include "RuntimeSALOME.hxx" +#include "PythonCppUtils.hxx" + +#if SALOME_KERNEL +#include "SALOME_Embedded_NamingService.hxx" +#include "SALOME_ContainerManager.hxx" +#include "SALOME_NamingService_Wrapper.hxx" +#endif using namespace YACS; using namespace std; @@ -30,4 +38,30 @@ CPPUNIT_TEST_SUITE_REGISTRATION( YacsLoaderTest ); // --- generic Main program from bases/Test -#include "BasicMainTest.hxx" +#include "BasicMainTestInternal.hxx" +#include "RuntimeSALOME.hxx" + +int main() +{ + YACS::ENGINE::RuntimeSALOME::setRuntime(); + YACS::ENGINE::RuntimeSALOME *rt = YACS::ENGINE::getSALOMERuntime(); + if( !rt ) + return 1; + Engines::EmbeddedNamingService_var ns = GetEmbeddedNamingService(); + CORBA::ORB_ptr orb = rt->getOrb(); + CORBA::String_var ior = orb->object_to_string( ns ); + AutoPyRef proc = rt->launchSubProcess({"./echoSrv",std::string(ior)}); + //std::cout << getpid() << std::endl; + usleep(3000000); + int ret = BasicMainTestInternal(); + // + SALOME_NamingService_Wrapper namingService(orb); + CORBA::Object_var objDSM(namingService.Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS)); + Engines::ContainerManager_var dsm(Engines::ContainerManager::_narrow(objDSM)); + dsm->ShutdownContainers(); + // + AutoGIL agil; + AutoPyRef terminateStr = PyUnicode_FromString("terminate"); + AutoPyRef dummy = PyObject_CallMethodObjArgs(proc,terminateStr,nullptr); + return ret; +}