]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Merge branch 'V8_0_0_BR'
authorvsr <vsr@opencascade.com>
Wed, 9 Mar 2016 14:54:00 +0000 (17:54 +0300)
committervsr <vsr@opencascade.com>
Wed, 9 Mar 2016 15:12:30 +0000 (18:12 +0300)
31 files changed:
CMakeLists.txt
src/CTestTestfileInstall.cmake
src/engine/ElementaryNode.cxx
src/engine/Executor.cxx
src/engine/ForEachLoop.cxx
src/engine/ForEachLoop.hxx
src/engine/InputPort.cxx
src/engine/InputPort.hxx
src/evalyfx/YACSEvalResource.cxx
src/evalyfx/YACSEvalResource.hxx
src/evalyfx/YACSEvalYFX.cxx
src/evalyfx/YACSEvalYFX.hxx
src/evalyfx/YACSEvalYFXPattern.cxx
src/evalyfx/YACSEvalYFXPattern.hxx
src/evalyfx_swig/evalyfx.i
src/evalyfx_swig/test1.py
src/evalyfx_swig/test2.py [new file with mode: 0644]
src/pmml/Test/CMakeLists.txt
src/pmml/Test/CTestTestfileInstall.cmake [new file with mode: 0644]
src/pmml/pmml_swig/CMakeLists.txt
src/pmml/pmml_swig/PMMLBasicsTestLauncher.py [new file with mode: 0755]
src/runtime/PythonNode.cxx
src/runtime/PythonPorts.cxx
src/runtime/PythonPorts.hxx
src/yacsloader/Test/CTestTestfileInstall.cmake
src/yacsloader/Test/YacsLoaderTest.sh.in
src/yacsloader/parsers.cxx
src/yacsloader/pmml/CMakeLists.txt
src/yacsloader/pmml/PmmlExeTest.sh.in
src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py
src/yacsloader_swig/Test/YacsLoaderTest.sh.in

index bc8cbc199567b62fef1eb0611ab4ad5974cb106c..09e19956203576468b37ddf5ac8033b60a79f369 100644 (file)
@@ -34,7 +34,7 @@ SET(${PROJECT_NAME_UC}_MINOR_VERSION 0)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
 # Find KERNEL (optional)
 # ==============
index 87893b4350c29ce842ffe065dc3b946f99db2f09..ca668f9dd514a9e63a6a3312d1d552002ef43a92 100644 (file)
@@ -30,6 +30,7 @@ SUBDIRS(
     bases
     engine
     runtime
+    pmml
     yacsloader
     yacsloader_swig
     )
index c92608532737687451e29f7c29a21699adb380c7..76841e73633e477d0f4a97be280d49c9bd40deba 100644 (file)
@@ -92,17 +92,17 @@ void ElementaryNode::initCommonPartWithoutStateManagement(bool start)
   for(list<InputPort *>::iterator iter2=_setOfInputPort.begin();iter2!=_setOfInputPort.end();iter2++)
     (*iter2)->exInit(start);
   _inGate.exReset();
-  if(_state == YACS::DISABLED)
-    {
-      exDisabledState(); // to refresh propagation of DISABLED state
-      return;
-    }
 }
 
 void ElementaryNode::init(bool start)
 {
   DEBTRACE("ElementaryNode::init " << getName() << " " << start << " " << _state);
   initCommonPartWithoutStateManagement(start);
+  if(_state == YACS::DISABLED)
+    {
+      exDisabledState(); // to refresh propagation of DISABLED state
+      return ;
+    }
   setState(YACS::READY);
 }
 
index ac80226829746b2fb4df76361ef763e8b48cde94..1130df735062aadeef730193f6a9b1033b36314d 100644 (file)
@@ -72,8 +72,8 @@ using YACS::BASES::Semaphore;
 //#define _DEVDEBUG_
 #include "YacsTrace.hxx"
 
-int Executor::_maxThreads(50);
-size_t Executor::_threadStackSize(1048576); // Default thread stack size is 1MB
+int Executor::_maxThreads(1000);
+size_t Executor::_threadStackSize(262144); // Default thread stack size is 256 kB == 2**18 because threads launched by YACS are lightweight
 
 Executor::Executor():_nbOfConcurrentThreads(0), _semForMaxThreads(_maxThreads),_keepGoingOnFail(false),_DPLScopeSensitive(false)
 {
index 3b9dec62cb8baa4e7fe63f4971cda31e067cb6ab..303cc1492ceb5aa9f55f25dadd52d5196de7de3f 100644 (file)
@@ -49,6 +49,8 @@ const char ForEachLoop::NAME_OF_SPLITTERNODE[]="splitter";
 
 const int ForEachLoop::NOT_RUNNING_BRANCH_ID=-1;
 
+const char ForEachLoop::INTERCEPTOR_STR[]="_interceptor";
+
 InterceptorInputPort::InterceptorInputPort(const std::string& name, Node *node, TypeCode* type):AnyInputPort(name,node,type),
                                                                                                 DataPort(name,node,type),Port(node),
                                                                                                 _repr(0)
@@ -877,6 +879,12 @@ YACS::Event ForEachLoop::updateStateOnFailedEventFrom(Node *node, const Executor
     }
 }
 
+void ForEachLoop::InterceptorizeNameOfPort(std::string& portName)
+{
+  std::replace_if(portName.begin(), portName.end(), std::bind1st(std::equal_to<char>(), '.'), '_');
+  portName += INTERCEPTOR_STR;
+}
+
 void ForEachLoop::buildDelegateOf(std::pair<OutPort *, OutPort *>& port, InPort *finalTarget, const std::list<ComposedNode *>& pointsOfView)
 {
   DynParaLoop::buildDelegateOf(port,finalTarget,pointsOfView);
@@ -904,12 +912,10 @@ void ForEachLoop::buildDelegateOf(std::pair<OutPort *, OutPort *>& port, InPort
           // the delegated port belongs to a node child of the ForEachLoop.
           // The name of the delegated port contains dots (bloc.node.outport),
           // whereas the name of the out going port shouldn't do.
-          std::string outputPortName = getPortName(port.first);
-          std::replace_if (outputPortName.begin(), outputPortName.end(),
-                           std::bind1st(std::equal_to<char>(), '.'), '_');
-          outputPortName += "_interceptor";
-          AnySplitOutputPort *newPort=new AnySplitOutputPort(outputPortName,this,newTc);
-          InterceptorInputPort *intercptor=new InterceptorInputPort(outputPortName + "_in",this,port.first->edGetType());
+          std::string outputPortName(getPortName(port.first));
+          InterceptorizeNameOfPort(outputPortName);
+          AnySplitOutputPort *newPort(new AnySplitOutputPort(outputPortName,this,newTc));
+          InterceptorInputPort *intercptor(new InterceptorInputPort(outputPortName + "_in",this,port.first->edGetType()));
           intercptor->setRepr(newPort);
           newTc->decrRef();
           newPort->addRepr(port.first,intercptor);
index d70259618bfaf919f7f1e815785d6437d271f25a..efb9888fb4e6bb2df5b175198a7a2f7e4151d039 100644 (file)
@@ -220,6 +220,9 @@ namespace YACS
       void storeOutValsInSeqForOutOfScopeUse(int rank, int branchNb);
     private:
       int getFinishedId();
+    public:
+      static void InterceptorizeNameOfPort(std::string& portName);
+      static const char INTERCEPTOR_STR[];
     };
   }
 } 
index d2b13e31d65c48cad39be071b5507e6fe783d1aa..569e5aacd63561938216e09ad1f0423456650b4e 100644 (file)
@@ -161,6 +161,11 @@ std::string InputPort::dump()
   return xmldump;
 }
 
+std::string InputPort::getHumanRepr()
+{
+  return dump();
+}
+
 void InputPort::setStringRef(std::string strRef)
 {
   _stringRef = strRef;
index 80c565f2236f9ce5bf39af1f1d33071dead3cea7..37c642dc93327dcbd9add4a3824ba182de27e9f5 100644 (file)
@@ -76,6 +76,7 @@ namespace YACS
       virtual void *get() const = 0;
       virtual void put(const void *data) throw(ConversionException) = 0;
       virtual std::string dump();
+      virtual std::string getHumanRepr();
       virtual void setStringRef(std::string strRef);
       virtual std::string typeName() {return "YACS__ENGINE__InputPort";}
       bool canBeNull() const;
index 92d1d419a9e16d054f9c21f6d965a3823c1624d2..2103d198d4138e4c55ceb78351a44fafe26f4781 100644 (file)
@@ -86,7 +86,8 @@ void YACSEvalVirtualYACSContainer::set(YACSEvalResource *gf, YACS::ENGINE::Conta
   if(_cont)
     _cont->decrRef();
   _cont=cont;
-  _cont->incrRef();
+  if(_cont)
+    _cont->incrRef();
   _propertyMap=listOfPropertiesInYACSContainer();
 }
 
@@ -206,6 +207,12 @@ void YACSEvalVirtualYACSContainer::apply()
     throw YACS::Exception("YACSEvalVirtualYACSContainer::apply : unrecognized container !");
 }
 
+std::string YACSEvalVirtualYACSContainer::getName() const
+{
+  checkNotNullYACSContainer();
+  return _cont->getName();
+}
+
 unsigned int YACSEvalVirtualYACSContainer::getValueOfKeyUInt(const char *key) const
 {
   std::string v(getValueOfKey(key));
@@ -229,6 +236,12 @@ std::map<std::string,std::string> YACSEvalVirtualYACSContainer::listOfProperties
   return props;
 }
 
+void YACSEvalVirtualYACSContainer::checkNotNullYACSContainer() const
+{
+  if(!_cont)
+    throw YACS::Exception("YACSEvalVirtualYACSContainer::checkNotNullYACSContainer : internal YACS container is NULL !");
+}
+
 YACSEvalResource::~YACSEvalResource()
 {
 }
@@ -380,7 +393,7 @@ bool YACSEvalListOfResources::isInteractive() const
           throw YACS::Exception(oss.str());
         }
       const ParserResourcesType& elt((*it2).second);
-      status[ii]=(elt.ClusterInternalProtocol==sh || elt.ClusterInternalProtocol==rsh || elt.ClusterInternalProtocol==ssh);
+      status[ii]=(elt.Batch==none);
     }
   std::size_t trueRet(std::count(status.begin(),status.end(),true)),falseRet(std::count(status.begin(),status.end(),false));
   if(trueRet==sz && falseRet==0)
index 4eee308fc2cac600eb74374ea60dda9ce3cdc89a..bd08e9c3dfc52450b22420db20f49fae88d1cd4f 100644 (file)
@@ -66,6 +66,7 @@ public:
   YACSEVALYFX_EXPORT std::string getValueOfKey(const char *key) const;
   YACSEVALYFX_EXPORT void setProperty(const std::string& key, const std::string &value);
   YACSEVALYFX_EXPORT void resetOverloadedProps() { checkNonLocked(); _overloadedPropertyMap.clear(); }
+  YACSEVALYFX_EXPORT std::string getName() const;
   void apply();
 public:
   YACSEvalVirtualYACSContainer();
@@ -81,6 +82,7 @@ private:
   unsigned int getNbProcPerNode() const { return getValueOfKeyUInt(NB_PROC_PER_NODE_KEY); }
   unsigned int getValueOfKeyUInt(const char *key) const;
   std::map<std::string,std::string> listOfPropertiesInYACSContainer() const;
+  void checkNotNullYACSContainer() const;
 public:
   static const char CONTAINER_NAME_KEY[];
   static const char CPU_CLOCK_KEY[];
index b3fcb25e360b45bab9a8b3ee1ec1ed410e520696..dc94ec8fdffaea2e28d3b25581d3fd0234955f66 100644 (file)
@@ -137,11 +137,26 @@ YACSEvalObserver *YACSEvalYFX::getObserver()
   return _pattern->getObserver();
 }
 
+std::string YACSEvalYFX::getErrorDetailsInCaseOfFailure() const
+{
+  return _pattern->getErrorDetailsInCaseOfFailure();
+}
+
+std::string YACSEvalYFX::getStatusOfRunStr() const
+{
+  return _pattern->getStatusOfRunStr();
+}
+
 std::vector<YACSEvalSeqAny *> YACSEvalYFX::getResults() const
 {
   return _pattern->getResults();
 }
 
+std::vector<YACSEvalSeqAny *> YACSEvalYFX::getResultsInCaseOfFailure(std::vector<unsigned int>& passedIds) const
+{
+  return _pattern->getResultsInCaseOfFailure(passedIds);
+}
+
 YACS::ENGINE::Proc *YACSEvalYFX::getUndergroundGeneratedGraph() const
 {
   return _pattern->getUndergroundGeneratedGraph();
index 14dcc957385eb53be04c1561ab2f1da9009dd678..a881e15d11e4d4e883f9c0adaefa900cb8c8d976 100644 (file)
@@ -58,7 +58,10 @@ public:
   YACSEVALYFX_EXPORT bool run(YACSEvalSession *session, int& nbOfBranches);
   YACSEVALYFX_EXPORT void registerObserver(YACSEvalObserver *observer);
   YACSEVALYFX_EXPORT YACSEvalObserver *getObserver();
+  YACSEVALYFX_EXPORT std::string getErrorDetailsInCaseOfFailure() const;
+  YACSEVALYFX_EXPORT std::string getStatusOfRunStr() const;
   YACSEVALYFX_EXPORT std::vector<YACSEvalSeqAny *> getResults() const;
+  YACSEVALYFX_EXPORT std::vector<YACSEvalSeqAny *> getResultsInCaseOfFailure(std::vector<unsigned int>& passedIds) const;
   //
   YACSEVALYFX_EXPORT YACS::ENGINE::Proc *getUndergroundGeneratedGraph() const;
   YACSEVALYFX_EXPORT void setParallelizeStatus(bool newVal);
index 8e351fed7538636f08c4496550d9ed25630903a4..6a787645c69fa8ecd93c3964006faa03b3e229ef 100644 (file)
@@ -27,6 +27,7 @@
 #include "ElementaryNode.hxx"
 #include "RuntimeSALOME.hxx"
 #include "Dispatcher.hxx"
+#include "Executor.hxx"
 #include "InputPort.hxx"
 #include "LinkInfo.hxx"
 #include "TypeCode.hxx"
 #include <limits>
 #include <numeric>
 #include <sstream>
+#include <iterator>
 
 const char YACSEvalYFXPattern::DFT_PROC_NAME[]="YFX";
 
+const char YACSEvalYFXPattern::ST_OK[]="ALL_OK";
+
+const char YACSEvalYFXPattern::ST_FAILED[]="SOME_SAMPLES_FAILED_AND_ALL_OF_THEM_FAILED_DETERMINISTICALLY";
+
+const char YACSEvalYFXPattern::ST_ERROR[]="SOME_SAMPLES_FAILED_BUT_IMPOSSIBLE_TO_CONCLUDE_ON_THEM";
+
+const std::size_t YACSEvalYFXPattern::MAX_LGTH_OF_INP_DUMP=10000;
+
+const char YACSEvalYFXRunOnlyPattern::FIRST_FE_SUBNODE_NAME[]="Bloc";
+
 const char YACSEvalYFXRunOnlyPattern::GATHER_NODE_NAME[]="__gather__";
 
 std::vector< YACSEvalInputPort *> YACSEvalYFXPattern::getFreeInputPorts() const
@@ -228,6 +240,25 @@ YACSEvalSeqAny *YACSEvalYFXPattern::BuildValueInPort(YACS::ENGINE::InputPyPort *
     throw YACS::Exception("YACSEvalYFXPattern::GetValueInPort : not implemented yet for other than Double and Int !");
 }
 
+YACSEvalSeqAny *YACSEvalYFXPattern::BuildValueFromEngineFrmt(YACS::ENGINE::SequenceAny *data)
+{
+  unsigned int sz(data->size());
+  std::vector<double> eltCpp(sz);
+  for(unsigned int ii=0;ii<sz;ii++)
+    {
+      YACS::ENGINE::AnyPtr elt((*data)[ii]);
+      YACS::ENGINE::Any *eltPtr((YACS::ENGINE::Any *)elt);
+      YACS::ENGINE::AtomAny *eltPtr2(dynamic_cast<YACS::ENGINE::AtomAny *>(eltPtr));
+      if(!eltPtr2)
+        {
+          std::ostringstream oss; oss << "YACSEvalYFXPattern::BuildValueFromEngineFrmt : error at pos #" << ii << " ! It is not an AtomAny !";
+          throw YACS::Exception(oss.str());
+        }
+      eltCpp[ii]=eltPtr2->getDoubleValue();
+    }
+  return new YACSEvalSeqAnyDouble(eltCpp);
+}
+
 void YACSEvalYFXPattern::cleanScheme()
 {
   if(_ownScheme)
@@ -336,7 +367,7 @@ void YACSEvalYFXRunOnlyPattern::generateGraph()
   _generatedGraph->edAddChild(n2);
   _generatedGraph->edAddCFLink(n1,n2);
   //
-  YACS::ENGINE::Bloc *n10(r->createBloc("Bloc"));
+  YACS::ENGINE::Bloc *n10(r->createBloc(FIRST_FE_SUBNODE_NAME));
   n1->edAddChild(n10);
   YACS::ENGINE::InlineNode *n100(r->createScriptNode(YACS::ENGINE::PythonNode::KIND,"__dispatch__"));
   YACS::ENGINE::Node *n101(_runNode->cloneWithoutCompAndContDeepCpy(0,true));
@@ -454,6 +485,84 @@ YACS::ENGINE::Proc *YACSEvalYFXRunOnlyPattern::getUndergroundGeneratedGraph() co
   return _generatedGraph;
 }
 
+std::string YACSEvalYFXRunOnlyPattern::getErrorDetailsInCaseOfFailure() const
+{
+  std::string st(getStatusOfRunStr());//test if a run has occurred.
+  if(st==ST_OK)
+    throw YACS::Exception("YACSEvalYFXRunOnlyPattern::getErrorDetailsInCaseOfFailure : The execution of scheme has been carried out to the end without any problem !");
+  // All the problem can only comes from foreach -> scan it
+  YACS::ENGINE::ForEachLoop *fe(findTopForEach());
+  YACS::ENGINE::NodeStateNameMap nsm;
+  unsigned nbB(fe->getNumberOfBranchesCreatedDyn());
+  std::ostringstream oss;
+  for(unsigned j=0;j<nbB;j++)
+    {
+      YACS::ENGINE::Node *nn(fe->getChildByNameExec(FIRST_FE_SUBNODE_NAME,j));
+      YACS::ENGINE::Bloc *nnc(dynamic_cast<YACS::ENGINE::Bloc *>(nn));
+      if(!nnc)
+        throw YACS::Exception("YACSEvalYFXRunOnlyPattern::getErrorDetailsInCaseOfFailure : internal error 1 ! The direct son of main foreach is expected to be a Bloc !");
+      if(nnc->getState()==YACS::DONE)
+        continue;
+      std::list< YACS::ENGINE::ElementaryNode *> fec(nnc->getRecursiveConstituents());
+      for(std::list< YACS::ENGINE::ElementaryNode *>::reverse_iterator it=fec.rbegin();it!=fec.rend();it++)
+        {
+          YACS::StatesForNode st0((*it)->getState());
+          if(st0!=YACS::DONE)
+            {
+              oss << "NODE = " << nnc->getChildName(*it) << std::endl;
+              oss << "STATUS = " << nsm[st0] << std::endl;
+              oss << "BRANCH ID = " << j << std::endl;
+              std::list<YACS::ENGINE::InputPort *> inps((*it)->getSetOfInputPort());
+              for(std::list<YACS::ENGINE::InputPort *>::const_iterator it=inps.begin();it!=inps.end();it++)
+                {
+                  std::string d((*it)->getHumanRepr());
+                  if(d.size()>10000)
+                    d=d.substr(0,MAX_LGTH_OF_INP_DUMP);
+                  oss << "INPUT \"" << (*it)->getName() << "\" = " << d << std::endl;
+                }
+              oss << "DETAILS = " << std::endl;
+              oss << (*it)->getErrorDetails();
+            }
+        }
+    }
+  return oss.str();
+}
+
+std::string YACSEvalYFXRunOnlyPattern::getStatusOfRunStr() const
+{
+  YACS::StatesForNode st(_generatedGraph->getState());
+  switch(st)
+    {
+    case YACS::READY:
+    case YACS::TOLOAD:
+    case YACS::LOADED:
+    case YACS::TOACTIVATE:
+    case YACS::ACTIVATED:
+    case YACS::SUSPENDED:
+    case YACS::PAUSE:
+    case YACS::DISABLED:
+    case YACS::DESACTIVATED:
+      {
+        std::ostringstream oss; oss << "YACSEvalYFXRunOnlyPattern::getStatusOfRunStr : Unexpected state \"" << YACS::ENGINE::Node::getStateName(st) << "\" ! Did you invoke run ?";
+        throw YACS::Exception(oss.str());
+      }
+    case YACS::LOADFAILED:
+    case YACS::EXECFAILED:
+    case YACS::ERROR:
+    case YACS::INTERNALERR:
+      return std::string(ST_ERROR);
+    case YACS::FAILED:
+      return std::string(ST_FAILED);
+    case YACS::DONE:
+      return std::string(ST_OK);
+    default:
+      {
+        std::ostringstream oss; oss << "YACSEvalYFXRunOnlyPattern::getStatusOfRunStr : unrecognized and managed state \"" << YACS::ENGINE::Node::getStateName(st) << "\" !";
+        throw YACS::Exception(oss.str());
+      }
+    }
+}
+
 std::vector<YACSEvalSeqAny *> YACSEvalYFXRunOnlyPattern::getResults() const
 {
   if(_generatedGraph->getState()!=YACS::DONE)
@@ -478,6 +587,59 @@ std::vector<YACSEvalSeqAny *> YACSEvalYFXRunOnlyPattern::getResults() const
   return ret;
 }
 
+/*!
+ * This method works if run succeeded (true return) and also if graph has failed. Graph failed means soft error of evaluation due to error in evaluation (example 1/0 or a normal throw from one node)
+ * If a more serious error occured (SIGSEGV of a server or internal error in YACS engine, cluster error, loose of connection...) this method will throw an exception to warn the caller that the results may be 
+ */
+std::vector<YACSEvalSeqAny *> YACSEvalYFXRunOnlyPattern::getResultsInCaseOfFailure(std::vector<unsigned int>& passedIds) const
+{
+  YACS::StatesForNode st(_generatedGraph->getState());
+  if(st==YACS::DONE)
+    {
+      passedIds.clear();
+      std::vector<YACSEvalSeqAny *> ret(getResults());
+      if(!ret.empty())
+        {
+          if(!ret[0])
+            throw YACS::Exception("YACSEvalYFXRunOnlyPattern::getResultsInCaseOfFailure : internal error ! The returned vector has a null pointer at pos #0 !");
+          std::size_t sz(ret[0]->size());
+          passedIds.resize(sz);
+          for(std::size_t i=0;i<sz;i++)
+            passedIds[i]=i;
+        }
+      return ret;
+    }
+  getStatusOfRunStr();// To check that the status is recognized.
+  std::list<YACS::ENGINE::Node *> lns(_generatedGraph->edGetDirectDescendants());
+  YACS::ENGINE::ForEachLoop *fe(findTopForEach());
+  //
+  YACS::ENGINE::Executor exe;
+  std::vector<YACS::ENGINE::SequenceAny *> outputs;
+  std::vector<std::string> nameOfOutputs;
+  passedIds=fe->getPassedResults(&exe,outputs,nameOfOutputs);//<- the key invokation is here.
+  std::size_t sz(passedIds.size()),ii(0);
+  std::vector<YACSEvalSeqAny *> ret(_outputsOfInterest.size());
+  for(std::vector<YACSEvalOutputPort *>::const_iterator it=_outputsOfInterest.begin();it!=_outputsOfInterest.end();it++,ii++)
+    {
+      YACS::ENGINE::OutputPort *p((*it)->getUndergroundPtr());
+      std::string st(_runNode->getOutPortName(p));
+      std::ostringstream oss; oss << FIRST_FE_SUBNODE_NAME << '.' << _runNode->getName() << '.' << st;
+      st=oss.str();
+      YACS::ENGINE::ForEachLoop::InterceptorizeNameOfPort(st);
+      std::vector<std::string>::iterator it(std::find(nameOfOutputs.begin(),nameOfOutputs.end(),st));
+      if(it==nameOfOutputs.end())
+        {
+          std::ostringstream oss; oss << "YACSEvalYFXRunOnlyPattern::getResultsInCaseOfFailure : internal error 3 ! Unable to locate interceptor with name " << st << " ! Possibilities are : ";
+          std::copy(nameOfOutputs.begin(),nameOfOutputs.end(),std::ostream_iterator<std::string>(oss," "));
+          oss << " !";
+          throw YACS::Exception(oss.str());
+        }
+      std::size_t pos(std::distance(nameOfOutputs.begin(),it));
+      ret[ii]=BuildValueFromEngineFrmt(outputs[pos]);
+    }
+  return ret;
+}
+
 void YACSEvalYFXRunOnlyPattern::emitStart() const
 {
   YACSEvalObserver *obs(getObserver());
@@ -566,3 +728,17 @@ void YACSEvalYFXRunOnlyPattern::buildOutputPorts()
     }
 }
 
+YACS::ENGINE::ForEachLoop *YACSEvalYFXRunOnlyPattern::findTopForEach() const
+{
+  std::list<YACS::ENGINE::Node *> lns(_generatedGraph->edGetDirectDescendants());
+  YACS::ENGINE::ForEachLoop *fe(0);
+  for(std::list<YACS::ENGINE::Node *>::const_iterator it=lns.begin();it!=lns.end();it++)
+    {
+      fe=dynamic_cast<YACS::ENGINE::ForEachLoop *>(*it);
+      if(fe)
+        break;
+    }
+  if(!fe)
+    throw YACS::Exception("YACSEvalYFXRunOnlyPattern::findTopForEach : internal error 2 ! ForEach is not accessible !");
+  return fe;
+}
index ea3c4d4fa802fab0c5b4bd88882f970483335666..4a9654bd552541431ce8aad01d1b82bfaa835610 100644 (file)
@@ -38,6 +38,7 @@ namespace YACS
     class ForEachLoop;
     class ComposedNode;
     class InputPyPort;
+    class SequenceAny;
   }
 }
 
@@ -74,7 +75,10 @@ public:
   virtual bool isLocked() const = 0;
   virtual YACSEvalListOfResources *giveResources() = 0;
   virtual YACS::ENGINE::Proc *getUndergroundGeneratedGraph() const = 0;
+  virtual std::string getErrorDetailsInCaseOfFailure() const = 0;
+  virtual std::string getStatusOfRunStr() const = 0;
   virtual std::vector<YACSEvalSeqAny *> getResults() const = 0;
+  virtual std::vector<YACSEvalSeqAny *> getResultsInCaseOfFailure(std::vector<unsigned int>& passedIds) const = 0;
   virtual void emitStart() const = 0;
 public:
   static const char DFT_PROC_NAME[];
@@ -86,6 +90,7 @@ protected:
   YACSEvalListOfResources *getResourcesInternal() const { return _res; }
   ResourcesManager_cpp *getCatalogInAppli() const { return _rm; }
   static YACSEvalSeqAny *BuildValueInPort(YACS::ENGINE::InputPyPort *port);
+  static YACSEvalSeqAny *BuildValueFromEngineFrmt(YACS::ENGINE::SequenceAny *data);
 private:
   void cleanScheme();
 private:
@@ -99,6 +104,11 @@ private:
 protected:
   std::vector< YACSEvalInputPort > _inputs;
   std::vector< YACSEvalOutputPort > _outputs;
+public:
+  static const char ST_OK[]; // execution goes to the end without any trouble -> results can be exploited without any problem with getResults and getResultsInCaseOfFailure.
+  static const char ST_FAILED[]; // execution has reached some failed evaluation (normal errors due to incapacity of one node to evaluate) -> results can be exploited without any problem with getResultsInCaseOfFailure
+  static const char ST_ERROR[]; // execution has encountered hard errors (SIGSEGV in a server, internal error in YACS) -> results can be exploited with getResultsInCaseOfFailure but you can't make hypothesis for other ids not in passedIds.
+  static const std::size_t MAX_LGTH_OF_INP_DUMP;
 };
 
 class YACSEvalYFXRunOnlyPattern : public YACSEvalYFXPattern
@@ -115,16 +125,21 @@ public:
   bool isLocked() const;
   YACSEvalListOfResources *giveResources();
   YACS::ENGINE::Proc *getUndergroundGeneratedGraph() const;
+  std::string getErrorDetailsInCaseOfFailure() const;
+  std::string getStatusOfRunStr() const;
   std::vector<YACSEvalSeqAny *> getResults() const;
+  std::vector<YACSEvalSeqAny *> getResultsInCaseOfFailure(std::vector<unsigned int>& passedIds) const;
   void emitStart() const;
   //
   YACS::ENGINE::ForEachLoop *getUndergroundForEach() const { return _FEInGeneratedGraph; }
   static bool IsMatching(YACS::ENGINE::Proc *scheme, YACS::ENGINE::ComposedNode *& runNode);
 public:
+  static const char FIRST_FE_SUBNODE_NAME[];
   static const char GATHER_NODE_NAME[];
 private:
   void buildInputPorts();
   void buildOutputPorts();
+  YACS::ENGINE::ForEachLoop *findTopForEach() const;
 private:
   YACS::ENGINE::ComposedNode *_runNode;
   std::vector<YACSEvalOutputPort *> _outputsOfInterest;
index 89668a64e699ec03b41877d64b0fde50366730c7..adc8c0a2ffc35160919b5e2825dce481910863e1 100644 (file)
@@ -75,6 +75,15 @@ static void convertPyToIntArr(PyObject *pyLi, std::vector<int>& arr)
     }
 }
 
+static PyObject *convertToPyToInt(const std::vector<unsigned int>& arr)
+{
+  std::size_t sz(arr.size());
+  PyObject *ret(PyList_New(sz));
+  for(std::size_t i=0;i<sz;i++)
+    PyList_SetItem(ret,i,PyInt_FromLong(arr[i]));
+  return ret;
+}
+
 static void convertPyToDblArr(PyObject *pyLi, std::vector<double>& arr)
 {
   if(PyList_Check(pyLi))
@@ -114,6 +123,40 @@ static void convertPyToDblArr(PyObject *pyLi, std::vector<double>& arr)
       throw YACS::Exception("convertPyToNewIntArr3 : not a list nor a tuple");
     }
 }
+
+static PyObject *convertVectOfSeqAny(const std::vector<YACSEvalSeqAny *>& retCpp)
+{
+  std::size_t sz(retCpp.size());
+  PyObject *ret(PyList_New(sz));
+  for(std::size_t i=0;i<sz;i++)
+    {
+      YACSEvalSeqAny *elt(retCpp[i]);
+      YACSEvalSeqAnyDouble *elt1(dynamic_cast<YACSEvalSeqAnyDouble *>(elt));
+      YACSEvalSeqAnyInt *elt2(dynamic_cast<YACSEvalSeqAnyInt *>(elt));
+      if(elt1)
+        {
+          std::vector<double> *zeArr(elt1->getInternal());
+          std::size_t sz2(zeArr->size());
+          PyObject *ret2(PyList_New(sz2));
+          for(std::size_t i2=0;i2<sz2;i2++)
+            PyList_SetItem(ret2,i2,PyFloat_FromDouble((*zeArr)[i2]));
+          PyList_SetItem(ret,i,ret2);
+        }
+      else if(elt2)
+        {
+          std::vector<int> *zeArr(elt2->getInternal());
+          std::size_t sz2(zeArr->size());
+          PyObject *ret2(PyList_New(sz2));
+          for(std::size_t i2=0;i2<sz2;i2++)
+            PyList_SetItem(ret2,i2,PyInt_FromLong((*zeArr)[i2]));
+          PyList_SetItem(ret,i,ret2);
+        }
+      else
+        throw YACS::Exception("wrap of YACSEvalYFX.getResults : unrecognized type !");
+      delete elt;
+    }
+  return ret;
+}
 %}
 
 %types(YACSEvalInputPort,YACSEvalOutputPort);
@@ -266,6 +309,7 @@ public:
   std::vector<std::string> listOfPropertyKeys() const;
   std::string getValueOfKey(const char *key) const;
   void setProperty(const std::string& key, const std::string &value);
+  std::string getName() const;
 private:
   YACSEvalVirtualYACSContainer();
 };
@@ -351,6 +395,8 @@ public:
   bool isLocked() const;
   YACS::ENGINE::Proc *getUndergroundGeneratedGraph() const;
   YACSEvalListOfResources *giveResources();
+  std::string getErrorDetailsInCaseOfFailure() const;
+  std::string getStatusOfRunStr() const;
   void setParallelizeStatus(bool newVal);
   bool getParallelizeStatus() const;
   //void registerObserver(YACSEvalObserver *observer);
@@ -409,36 +455,17 @@ public:
        PyObject *getResults() const
        {
          std::vector<YACSEvalSeqAny *> retCpp(self->getResults());
-         std::size_t sz(retCpp.size());
-         PyObject *ret(PyList_New(sz));
-         for(std::size_t i=0;i<sz;i++)
-           {
-             YACSEvalSeqAny *elt(retCpp[i]);
-             YACSEvalSeqAnyDouble *elt1(dynamic_cast<YACSEvalSeqAnyDouble *>(elt));
-             YACSEvalSeqAnyInt *elt2(dynamic_cast<YACSEvalSeqAnyInt *>(elt));
-             if(elt1)
-               {
-                 std::vector<double> *zeArr(elt1->getInternal());
-                 std::size_t sz2(zeArr->size());
-                 PyObject *ret2(PyList_New(sz2));
-                 for(std::size_t i2=0;i2<sz2;i2++)
-                   PyList_SetItem(ret2,i2,PyFloat_FromDouble((*zeArr)[i2]));
-                 PyList_SetItem(ret,i,ret2);
-               }
-             else if(elt2)
-               {
-                 std::vector<int> *zeArr(elt2->getInternal());
-                 std::size_t sz2(zeArr->size());
-                 PyObject *ret2(PyList_New(sz2));
-                 for(std::size_t i2=0;i2<sz2;i2++)
-                   PyList_SetItem(ret2,i2,PyInt_FromLong((*zeArr)[i2]));
-                 PyList_SetItem(ret,i,ret2);
-               }
-             else
-               throw YACS::Exception("wrap of YACSEvalYFX.getResults : unrecognized type !");
-             delete elt;
-           }
-         return ret;
+         return convertVectOfSeqAny(retCpp);
+       }
+
+       PyObject *getResultsInCaseOfFailure() const
+       {
+         std::vector<unsigned int> ret1Cpp;
+         std::vector<YACSEvalSeqAny *> ret0Cpp(self->getResultsInCaseOfFailure(ret1Cpp));
+         PyObject *retPy(PyTuple_New(2));
+         PyTuple_SetItem(retPy,0,convertVectOfSeqAny(ret0Cpp));
+         PyTuple_SetItem(retPy,1,convertToPyToInt(ret1Cpp));
+         return retPy;
        }
 
        PyObject *run(YACSEvalSession *session)
index e52a597baf0681317a56cd5487ac0cfce2fb19c4..b7bf3642389c87a1bd231d51ade03c6024454a11 100644 (file)
@@ -24,6 +24,7 @@ fname="test1.xml"
 import evalyfx
 session=evalyfx.YACSEvalSession()
 session.launch()
+buildScheme(fname)
 efx=evalyfx.YACSEvalYFX.BuildFromFile(fname)
 efx.setParallelizeStatus(False)
 inps=efx.getFreeInputPorts()
diff --git a/src/evalyfx_swig/test2.py b/src/evalyfx_swig/test2.py
new file mode 100644 (file)
index 0000000..b47d37c
--- /dev/null
@@ -0,0 +1,51 @@
+# bug revealed by otgui on 8/2/16. Several lock/unlock session. test1.xml is Cogeneration.xml.
+
+def buildScheme(fname):
+    import SALOMERuntime
+    import loader
+    SALOMERuntime.RuntimeSALOME.setRuntime()
+    r=SALOMERuntime.getSALOMERuntime()
+    p0=r.createProc("run")
+    #
+    p=r.createBloc("toto")
+    p0.edAddChild(p)
+    #
+    cont=p0.createContainer("MyWonderfulContainer","Salome")
+    td=p0.createType("double","double")
+    n0=r.createScriptNode("Salome","PyScript0")
+    p.edAddChild(n0)
+    q=n0.edAddInputPort("q",td)
+    ep=n0.edAddOutputPort("ep",td)
+    n0.setScript("ep=1./(4.-q)") # <- force division by 0
+    n0.setExecutionMode("remote")
+    n0.setContainer(cont)
+    p0.saveSchema(fname)
+    pass
+
+fname="test2.xml"
+import evalyfx
+session=evalyfx.YACSEvalSession()
+session.launch()
+buildScheme(fname)
+efx=evalyfx.YACSEvalYFX.BuildFromFile(fname)
+#efx.setParallelizeStatus(False)
+efx.getParams().setStopASAPAfterErrorStatus(False)
+inps=efx.getFreeInputPorts()
+assert(len(inps)==1)
+outps=efx.getFreeOutputPorts()
+inps[0].setSequenceOfValuesToEval([1.,2.,3.,4.,5.,6.])
+efx.lockPortsForEvaluation(inps,outps)
+rss=efx.giveResources()
+rss[0][0].setWantedMachine("localhost")
+a,b=efx.run(session)
+assert(efx.getStatusOfRunStr()=='SOME_SAMPLES_FAILED_AND_ALL_OF_THEM_FAILED_DETERMINISTICALLY')
+c,d=efx.getResultsInCaseOfFailure()
+assert(d==[0,1,2,4,5])# case 3 is not in !
+assert(len(c)==1)
+c=c[0]
+for f,g in zip(c,[0.3333333333333333,0.5,1.0,-1.0,-0.5]):
+    assert(abs(f-g)<1e-12)
+    pass
+st=efx.getErrorDetailsInCaseOfFailure()
+assert("NODE = toto.PyScript0" in st)
+assert("float division by zero" in st)
index 2b52afe29961a5e5989c1dd67af82373bfe7e978..6f9e4cb86ebc7fa2dc9aa0128498103801639f87 100755 (executable)
@@ -97,3 +97,10 @@ ADD_TEST(TestPMML TestPMML)
 
 FILE(COPY ${PROJECT_SOURCE_DIR}/src/pmml/Test/samples  DESTINATION . )
 INSTALL(TARGETS TestPMML DESTINATION ${SALOME_INSTALL_BINS})
+
+#
+
+SET(LOCAL_TEST_DIR ${SALOME_YACS_INSTALL_TEST}/pmml)
+FILE(COPY ${PROJECT_SOURCE_DIR}/src/pmml/Test/samples DESTINATION "${CMAKE_INSTALL_PREFIX}/${LOCAL_TEST_DIR}")
+INSTALL(TARGETS TestPMML DESTINATION ${LOCAL_TEST_DIR})
+INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake)
diff --git a/src/pmml/Test/CTestTestfileInstall.cmake b/src/pmml/Test/CTestTestfileInstall.cmake
new file mode 100644 (file)
index 0000000..a02c4de
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (C) 2015  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+IF(NOT WIN32)
+  ADD_TEST(YacsTestPMML TestPMML)
+  SET_TESTS_PROPERTIES(YacsTestPMML PROPERTIES LABELS "${COMPONENT_NAME}")
+  ADD_TEST(YacsPMMLBasicsTest python pmml_swig/PMMLBasicsTestLauncher.py)
+  SET_TESTS_PROPERTIES(YacsPMMLBasicsTest PROPERTIES LABELS "${COMPONENT_NAME}")
+ENDIF(NOT WIN32)
index c7c02ec05262f668de2cfc7587998ef012880040..8cc20bed192efbf7aaa6e107da16d54e9ee42580 100755 (executable)
@@ -69,3 +69,9 @@ INSTALL(FILES PMMLBasicsTest.py DESTINATION ${SALOME_INSTALL_SCRIPT_PYTHON})
 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
 ADD_TEST(PMMLBasicsTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PMMLBasicsTest.py)
 SET_TESTS_PROPERTIES(PMMLBasicsTest PROPERTIES ENVIRONMENT "${tests_env}")
+
+#
+
+SET(LOCAL_TEST_DIR ${SALOME_YACS_INSTALL_TEST}/pmml/pmml_swig)
+FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/PMMLBasicsTest.py DESTINATION "${CMAKE_INSTALL_PREFIX}/${LOCAL_TEST_DIR}")
+FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/PMMLBasicsTestLauncher.py DESTINATION "${CMAKE_INSTALL_PREFIX}/${LOCAL_TEST_DIR}")
diff --git a/src/pmml/pmml_swig/PMMLBasicsTestLauncher.py b/src/pmml/pmml_swig/PMMLBasicsTestLauncher.py
new file mode 100755 (executable)
index 0000000..36f2a0a
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+
+import os,sys,subprocess,shutil
+
+# Here the most beautiful part of test :)
+dirALaCon0="Test"
+dirAlaCon1="samples"
+if not os.path.exists(dirALaCon0):
+    os.mkdir(dirALaCon0)
+if not os.path.exists(os.path.join(dirALaCon0,dirAlaCon1)):
+    os.chdir(dirALaCon0)
+    os.symlink(os.path.join("..",dirAlaCon1),dirAlaCon1)
+    os.chdir("..")
+# GO !
+dn=os.path.dirname(__file__)
+p=subprocess.Popen(["python","PMMLBasicsTest.py"],cwd=dn,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+a,b=p.communicate()
+ret=p.returncode
+# Clean up the wonderful first part stuf
+shutil.rmtree(dirALaCon0)
+sys.exit(ret)
index ddf37d0cb39ebaaebc18708616e2b9b6a1f77da9..9160133f3568f57478af1d665d89f769056d3cce 100644 (file)
@@ -815,6 +815,11 @@ PyFuncNode::~PyFuncNode()
 void PyFuncNode::init(bool start)
 {
   initCommonPartWithoutStateManagement(start);
+  if(_state == YACS::DISABLED)
+    {
+      exDisabledState(); // to refresh propagation of DISABLED state
+      return ;
+    }
   if(start) //complete initialization
     setState(YACS::READY);
   else if(_state > YACS::LOADED)// WARNING FuncNode has internal vars (CEA usecase) ! Partial initialization (inside a loop). Exclusivity of funcNode.
index 4d25d1f09b534c27e40c2f8fe1ca664ef024024c..040a1d1cfa6963558ef3ae8f41b4226f629a4b88 100644 (file)
@@ -190,6 +190,21 @@ std::string InputPyPort::getAsString()
   return ret;
 }
 
+std::string InputPyPort::getHumanRepr()
+{
+  if(!_data)
+    return dump();
+  PyObject *ret(PyObject_Str(_data));
+  if(!ret)
+    return dump();
+  std::string retCpp;
+  char *val(PyString_AsString(ret));
+  if(val)
+    retCpp=val;
+  Py_XDECREF(ret);
+  return retCpp;
+}
+
 bool InputPyPort::isEmpty()
 {
   return _data == Py_None;
index 6fd09092538426cd4caae973bd5d3e66f16626f7..1c338b5d4bbdd61b899c967282fcb86b623a9209 100644 (file)
@@ -85,6 +85,7 @@ namespace YACS
       virtual PyObj * getPyObj() const;
       virtual std::string getAsString();
       void *get() const throw(Exception);
+      virtual std::string getHumanRepr();
       virtual bool isEmpty();
       virtual void exSaveInit();
       virtual void exRestoreInit();
index d03fc76e4cdb11d873f7bf02e8c2ad478a987150..23b27f05c4e712a3b0b49b05a8292f8a60246f45 100644 (file)
 #
 
 IF(NOT WIN32)
+  SET(SHELL /bin/sh)
   ADD_TEST(YacsLoaderTest python ${SALOME_TEST_DRIVER} ${TIMEOUT} ./runYacsLoaderTest.sh)
   SET_TESTS_PROPERTIES(YacsLoaderTest PROPERTIES
                                      LABELS "${COMPONENT_NAME}"
-                                     ENVIRONMENT "LD_LIBRARY_PATH=${YACS_TEST_LIB}:$ENV{LD_LIBRARY_PATH}"
-                      )
+                                     ENVIRONMENT "LD_LIBRARY_PATH=${YACS_TEST_LIB}:$ENV{LD_LIBRARY_PATH}")
+  ADD_TEST(YacsPmmlExeTest ${SHELL} ./PmmlExeTest.sh)
+  SET_TESTS_PROPERTIES(YacsPmmlExeTest PROPERTIES LABELS "${COMPONENT_NAME}")
 ENDIF()
index 749a1b0a2dabf2419b1e3a29d257bb688079c796..f393181d89f9a292e586638c20e82c0e98c68e33 100755 (executable)
@@ -49,7 +49,7 @@ EOF
   # --- launch in background a SALOME session (servers)
 
   ln -fs @CMAKE_SOURCE_DIR@/src/yacsloader/samples .
-  ./runAppli > log1 2>&1
+  ./salome > log1 2>&1 &
 
   # --- wait a little to let the background process define
   #     the CORBA naming service port and host
@@ -59,13 +59,13 @@ EOF
   # --- execute the test script in SALOME session environment
 
   chmod +x @CMAKE_CURRENT_BINARY_DIR@/YacsLoaderInSessionTest.sh
-  ./runSession @CMAKE_CURRENT_BINARY_DIR@/YacsLoaderInSessionTest.sh
+  ./salome shell @CMAKE_CURRENT_BINARY_DIR@/YacsLoaderInSessionTest.sh
   ret=$?
 
   # ---------------------------------------------------------------------------
 
   kill -9 `cat "/tmp/YACSTEST_PidEcho"`
-  ./runSession killSalome.py
+  ./salome shell python killSalome.py
 
   echo "exec status YacsLoaderInSessionTest.sh "  $ret
 
index 513dd1efc67fb2a3d09d8e9bc01e227aca132da6..3b621890b00e6946fcda57ec4104ac04875ff40d 100644 (file)
@@ -124,6 +124,8 @@ ENGINE::Proc* YACSLoader::load(const char * file)
   {
     if ( xmlParseDocument(saxContext) == -1 )
     {
+      if(!currentProc)
+        throw Exception("Basic error during parsing.");
       YACS::ENGINE::Logger* logger = currentProc->getLogger("parser");
       logger->fatal( saxContext->lastError.message, file, saxContext->input->line );
     }
@@ -132,6 +134,8 @@ ENGINE::Proc* YACSLoader::load(const char * file)
   }
   catch(Exception& e)
   {
+    if(!currentProc)
+      throw e;
     YACS::ENGINE::Logger* logger = currentProc->getLogger("parser");
     logger->fatal(e.what(), file, saxContext->input->line);
     saxContext = 0;
index e6f0e0a1d8f720fd8c4f25feb4023e903263a520..c16d51b946befba379cc9cb451c5d71256afbd75 100755 (executable)
@@ -60,4 +60,9 @@ IF(NOT WIN32)
   SALOME_CONFIGURE_FILE(PmmlExeTest.sh.in PmmlExeTest.sh)  
   SALOME_CONFIGURE_FILE(PmmlInSessionTest.sh.in PmmlInSessionTest.sh)
   ADD_TEST(NAME PmmlExeTest COMMAND ${SHELL} PmmlExeTest.sh)
-ENDIF()
\ No newline at end of file
+ENDIF()
+
+SET(LOCAL_TEST_DIR ${SALOME_YACS_INSTALL_TEST}/yacsloader)
+INSTALL(TARGETS TestYACSPMML DESTINATION ${LOCAL_TEST_DIR})
+INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/PmmlExeTest.sh DESTINATION ${LOCAL_TEST_DIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/config_appli.xml DESTINATION ${LOCAL_TEST_DIR})
\ No newline at end of file
index 09442b2265af0678cf60d2590b33d3de3488b6c2..46628f7a4e5b0468d371ca84ca7bf5ca09017421 100755 (executable)
@@ -49,7 +49,7 @@ EOF
   # --- launch in background a SALOME session (servers)
 
   ln -fs @CMAKE_SOURCE_DIR@/src/yacsloader/samples .
-  ./runAppli > log1 2>&1
+  ./salome > log1 2>&1 &
 
   # --- wait a little to let the background process define
   #     the CORBA naming service port and host
@@ -59,13 +59,13 @@ EOF
   # --- execute the test script in SALOME session environment
 
   chmod +x @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
-  ./runSession @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+  ./salome shell @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
   ret=$?
 
   # ---------------------------------------------------------------------------
 
   kill -9 `cat "/tmp/YACSTEST_PidEcho"`
-  ./runSession killSalome.py
+  ./salome shell python killSalome.py
 
   echo "exec status PmmlInSessionTest.sh "  $ret
 
index 962f579d840b84fde31b1cacbcbd2ef3e7988e24..6a52e6a286487eef8c1c81476e7d290b30f90647 100644 (file)
@@ -176,6 +176,22 @@ def sum(i):
     self.assertEqual(endNode_error.getPyObj(),0)
     pass
 
+  def test4(self):
+    """ test linked to TestSaveLoadRun.test20. This is a smaller test coming from EDF autotest"""
+    xmlFileName="test4.xml"
+    p=self.r.createProc("test26")
+    n=self.r.createScriptNode("","node1")
+    n.setScript("import os")
+    p.edAddChild(n)
+    n.setState(pilot.DISABLED)
+    #
+    ex=pilot.ExecutorSwig()
+    self.assertEqual(p.getState(),pilot.READY)
+    ex.RunW(p,0)
+    self.assertEqual(p.getState(),pilot.ACTIVATED)
+    self.assertEqual(n.getState(),pilot.DISABLED) # <- test is here.
+    pass
+
   def tearDown(self):
     del self.r
     del self.l
index e2517197ffba07bde07ac76c637df54d6802d526..f02137d0e7802da1c77cb97731d678bd414085c3 100755 (executable)
@@ -46,7 +46,7 @@ EOF
   # --- launch in background a SALOME session (servers)
 
   ln -fs @CMAKE_SOURCE_DIR@/src/yacsloader/samples .
-  ./runAppli > log1 2>&1
+  ./salome > log1 2>&1 &
 
   # --- wait a little to let the background process define
   #     the CORBA naming service port and host
@@ -56,13 +56,13 @@ EOF
   # --- execute the test script in SALOME session environment
 
   chmod +x @CMAKE_CURRENT_BINARY_DIR@/YacsLoaderInSessionTest.sh
-  ./runSession @CMAKE_CURRENT_BINARY_DIR@/YacsLoaderInSessionTest.sh
+  ./salome shell @CMAKE_CURRENT_BINARY_DIR@/YacsLoaderInSessionTest.sh
   ret=$?
 
   # ---------------------------------------------------------------------------
 
   kill -9 `cat "/tmp/YACSTEST_PidEcho"`
-  ./runSession killSalome.py
+  ./salome shell python killSalome.py
 
   echo "exec status YacsLoaderInSessionTest.sh "  $ret