1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 * Author : Renaud BARATE - EDF R&D
37 int main(int argc, char** argv)
40 cerr << "Exec_Test expects three parameters, usage: Exec_Test <scriptA> <scriptB> <result>" << endl;
44 const char * scriptAFileName = argv[1];
45 const char * scriptBFileName = argv[2];
46 const char * resultFileName = argv[3];
48 ifstream scriptAStream(scriptAFileName);
51 while (getline(scriptAStream, line)) {
52 if (line.compare(0, 2, string("a=")) == 0) {
53 a = strtol(line.substr(2).c_str(), NULL, 10);
56 scriptAStream.close();
58 cerr << "Exec_Test couldn't parse value \"a\" in " << scriptAFileName << endl;
62 ifstream scriptBStream(scriptBFileName);
64 while (getline(scriptBStream, line)) {
65 if (line.compare(0, 2, string("b=")) == 0) {
66 b = strtol(line.substr(2).c_str(), NULL, 10);
69 scriptBStream.close();
71 cerr << "Exec_Test couldn't parse value \"b\" in " << scriptBFileName << endl;
76 ofstream resultStream(resultFileName);
77 resultStream << "c = " << c;