Salome HOME
Update copyrights
[modules/yacs.git] / src / runtime / Test / runtimeTest.hxx
1 // Copyright (C) 2006-2019  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _RUNTIMETEST_HXX_
21 #define _RUNTIMETEST_HXX_
22
23 #include "RuntimeSALOME.hxx"
24 #include "TypeCode.hxx"
25
26 #ifdef USE_CPPUNIT
27 #include <cppunit/extensions/HelperMacros.h>
28 #else
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) \
36         try { x; } \
37         catch (y &e) { cerr << e.what() << endl; }
38 #endif
39
40 #include <string>
41 #include <map>
42
43 namespace YACS
44 {
45   class RuntimeTest
46 #ifdef USE_CPPUNIT
47                      : public CppUnit::TestFixture
48 #endif
49   {
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();
75     
76   public:
77       
78     void setUp();
79     void tearDown();
80       
81     void initRuntimeTypeCode();
82     void createPythonNodes();
83     void createCORBANodes();
84     void createBloc();
85     void createRecursiveBlocs();
86     void createDataLinks();
87     void createPythonNodesWithScript();
88     void createCORBANodesWithMethod();
89     void createXMLNodes();
90     void createBloc2();
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();
102     void convertPorts();
103      
104     void classTeardown();
105     
106   protected:
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;
110     static int _inode;
111     static int _ibloc;
112     static YACS::ENGINE::Runtime *_myRuntime;
113
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;
127     
128     static bool endTests;
129       
130   private:
131
132   };
133
134 }
135
136 #endif