interpreter-test.cc
Go to the documentation of this file.
1 // The purpose of this unit test is to evaluate the memory consumption
2 // when call the interpreter.
4 
5 int main(int argc, char** argv) {
6  int numTest = 1;
7  if (argc > 1) numTest = atoi(argv[1]);
8 
10  std::string command;
11  std::string result;
12  std::string out;
13  std::string err;
14 
15  for (int i = 0; i < numTest; ++i) {
16  // correct input
17  interp.python("print('I am the interpreter')", result, out, err);
18  assert(out.compare("I am the interpreter"));
19  assert(err.length() == 0);
20  // incorrect input
21  interp.python("print I am the interpreter", result, out, err);
22  assert(result.length() == 0);
23  assert(out.length() == 0);
24  assert(err.length() > 50);
25  }
26  return 0;
27 }
interpreter.hh
dynamicgraph::python::Interpreter
Definition: interpreter.hh:21
dynamicgraph::python::Interpreter::python
std::string python(const std::string &command)
Method to start python interperter.
Definition: interpreter.cc:138
main
int main(int argc, char **argv)
Definition: interpreter-test.cc:5


dynamic-graph-python
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Oct 27 2023 02:16:36