1 // Copyright (C) 2006-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _RUNTIMETEST_HXX_
21 #define _RUNTIMETEST_HXX_
23 #include "RuntimeSALOME.hxx"
24 #include "TypeCode.hxx"
27 #include <cppunit/extensions/HelperMacros.h>
29 #define CPPUNIT_TEST_SUITE(x)
30 #define CPPUNIT_TEST(x)
31 #define CPPUNIT_TEST_SUITE_END(x)
32 #define CPPUNIT_ASSERT(x) std::cerr << #x << " : " << (x) << std::endl
33 #define CPPUNIT_ASSERT_EQUAL(x,y) std::cerr << "Test " << #x << " == " << #y << " : " << ((x) == (y)) << std::endl;
34 #define CPPUNIT_ASSERT_DOUBLES_EQUAL(x,y,z)
35 #define CPPUNIT_ASSERT_THROW(x,y) \
37 catch (y &e) { cerr << e.what() << endl; }
47 : public CppUnit::TestFixture
50 CPPUNIT_TEST_SUITE( RuntimeTest );
51 CPPUNIT_TEST(initRuntimeTypeCode );
52 CPPUNIT_TEST(createPythonNodes );
53 CPPUNIT_TEST(createCORBANodes );
54 CPPUNIT_TEST(createBloc );
55 CPPUNIT_TEST(createRecursiveBlocs );
56 CPPUNIT_TEST(createDataLinks );
57 CPPUNIT_TEST(createPythonNodesWithScript );
58 CPPUNIT_TEST(createCORBANodesWithMethod );
59 CPPUNIT_TEST(createXMLNodes );
60 CPPUNIT_TEST(createBloc2 );
61 CPPUNIT_TEST(createDataLinksPythonPython );
62 CPPUNIT_TEST(createDataLinksPythonCORBA );
63 CPPUNIT_TEST(createDataLinksCORBACORBA );
64 CPPUNIT_TEST(createDataLinksCORBAPython );
65 CPPUNIT_TEST(createDataLinksXML );
66 CPPUNIT_TEST(manualInitInputPort );
67 CPPUNIT_TEST(manualExecuteNoThread );
68 CPPUNIT_TEST(manualGetOutputs );
69 CPPUNIT_TEST(createCppNodes );
70 CPPUNIT_TEST(convertPorts );
71 CPPUNIT_TEST(executeCppNode );
72 CPPUNIT_TEST(createGraphWithCppNodes );
73 CPPUNIT_TEST(classTeardown );
74 CPPUNIT_TEST_SUITE_END();
81 void initRuntimeTypeCode();
82 void createPythonNodes();
83 void createCORBANodes();
85 void createRecursiveBlocs();
86 void createDataLinks();
87 void createPythonNodesWithScript();
88 void createCORBANodesWithMethod();
89 void createXMLNodes();
91 void createDataLinksPythonPython();
92 void createDataLinksPythonCORBA();
93 void createDataLinksCORBACORBA();
94 void createDataLinksCORBAPython();
95 void createDataLinksXML();
96 void manualInitInputPort();
97 void manualExecuteNoThread();
98 void manualGetOutputs();
99 void createCppNodes();
100 void executeCppNode();
101 void createGraphWithCppNodes();
104 void classTeardown();
107 static std::map<std::string, YACS::ENGINE::Node*> _nodeMap;
108 static std::map<std::string, YACS::ENGINE::Bloc*> _blocMap;
109 static std::list<YACS::ENGINE::TypeCodeObjref *> _ltc;
112 static YACS::ENGINE::Runtime *_myRuntime;
114 static YACS::ENGINE::TypeCode *_tc_double;
115 static YACS::ENGINE::TypeCode *_tc_int;
116 static YACS::ENGINE::TypeCode *_tc_string;
117 static YACS::ENGINE::TypeCode *_tc;
118 static YACS::ENGINE::TypeCode *_tc_obj;
119 static YACS::ENGINE::TypeCode *_tc_seqdble;
120 static YACS::ENGINE::TypeCode *_tc_seqstr;
121 static YACS::ENGINE::TypeCode *_tc_seqlong;
122 static YACS::ENGINE::TypeCode *_tc_seqobj;
123 static YACS::ENGINE::TypeCode *_tc_seqseqdble;
124 static YACS::ENGINE::TypeCode *_tc_seqseqobj;
125 static YACS::ENGINE::TypeCode *_tc_C;
126 static YACS::ENGINE::TypeCode *_tc_seqC;
128 static bool endTests;