Classes | Functions | Variables
test-template Namespace Reference

Classes

class  TestGen
 

Functions

def _mkdir (newdir)
 

Variables

string bat_footer
 
string bat_header
 
string build_sh
 
string build_vc8_bat
 
string build_vc9_bat
 
list configs
 
string gen_main
 
list inports
 
string myservice_idl
 
string myservice_impl_cpp
 
string myservice_impl_h
 
list nums = [0, 1, 2, 10]
 
list outports
 
dictionary params
 
string rtm_config
 
string sh_footer
 
string sh_header
 
list svcports
 
 t = TestGen([0,1,5],[0,1,5],[0,1,5],[0,1,5])
 
string vector_convert_h
 
string yourservice_idl
 

Function Documentation

def test-template._mkdir (   newdir)
private
works the way a good mkdir should :)
- already exists, silently complete
- regular file in the way, raise an exception
- parent directory(ies) does not exist, make them as well

Definition at line 608 of file test-template.py.

Variable Documentation

string test-template.bat_footer
Initial value:
1 = """
2 
3 call copyprops.bat
4 for %%x in (*.tmp) do copy /y %%x %%~nx
5 
6 echo #include "VectorConvert.h" >> [name].h
7 
8 """

Definition at line 404 of file test-template.py.

string test-template.bat_header
Initial value:
1 = """\
2 @set PATH="%RTM_ROOT%\\utils\\rtc-template";%PATH%
3 @set PYTHONPATH="%RTM_ROOT%\\utils\\rtc-template"
4 
5 del /F /Q *.cpp *.h *.hh *.cc *.sln *.vcproj *.vsprops *.yaml
6 del /F /Q copyprops.bat Makefile.* README.*
7 
8 rmdir /Q /S [name]
9 
10 rmdir /Q /S [name]Comp
11 
12 """

Definition at line 379 of file test-template.py.

string test-template.build_sh
Initial value:
1 = """\
2 #!/bin/sh
3 
4 [for proj in projects]
5 cd [proj]
6 sh gen.sh
7 #make -f Makefile.[proj]
8 if test -f [proj]Comp; then
9  echo [proj]: OK >> ../build_status
10 else
11  echo [proj]: NG >> ../build_status
12 fi
13 cd ..
14 [endfor]
15 """

Definition at line 448 of file test-template.py.

string test-template.build_vc8_bat
Initial value:
1 = """\
2 @set PATH="C:\\Program Files\\Microsoft Visual Studio 8\\VC\\vcpackages";%PATH%
3 
4 [for proj in projects]
5 cd [proj]
6 call gen.bat
7 vcbuild [proj]_vc8.sln
8 cd ..
9 [endfor]
10 """

Definition at line 426 of file test-template.py.

string test-template.build_vc9_bat
Initial value:
1 = """\
2 @set PATH="C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcpackages";%PATH%
3 
4 [for proj in projects]
5 cd [proj]
6 call gen.bat
7 vcbuild [proj]_vc9.sln
8 cd ..
9 [endfor]
10 """

Definition at line 437 of file test-template.py.

list test-template.configs

Definition at line 510 of file test-template.py.

string test-template.gen_main
Initial value:
1 = """\
2 rtc-template -bcxx
3  --module-name=[name] --module-desc="Test RTC for rtc-template"
4  --module-version=1.0.0 --module-vendor=AIST --module-category=Test
5  --module-comp-type=DataFlowComponent --module-act-type=SPORADIC
6  --module-max-inst=10
7 [for ip in inports]
8  --inport="[ip.name]:[ip.type]"
9 [endfor]
10 
11 [for op in outports]
12  --outport="[op.name]:[op.type]"
13 [endfor]
14 
15 [for sp in svcports]
16  --[sp.direction]="[sp.port_name]:[sp.inst_name]:[sp.type]"
17  --[sp.direction]-idl="[sp.idl_file]"
18 [endfor]
19 
20 [for cf in configs]
21  --config="[cf.name]:[cf.type]:[cf.default]"
22 [endfor]
23 """

Definition at line 223 of file test-template.py.

list test-template.inports
Initial value:
1 = [
2  {"name": "in00", "type": "TimedShort"},
3  {"name": "in01", "type": "TimedLong"},
4  {"name": "in02", "type": "TimedUShort"},
5  {"name": "in03", "type": "TimedULong"},
6  {"name": "in04", "type": "TimedFloat"},
7  {"name": "in05", "type": "TimedDouble"},
8  {"name": "in06", "type": "TimedChar"},
9  {"name": "in07", "type": "TimedBoolean"},
10  {"name": "in08", "type": "TimedOctet"},
11  {"name": "in09", "type": "TimedString"},
12  {"name": "in10", "type": "TimedShortSeq"},
13  {"name": "in11", "type": "TimedLongSeq"},
14  {"name": "in12", "type": "TimedUShortSeq"},
15  {"name": "in13", "type": "TimedULongSeq"},
16  {"name": "in14", "type": "TimedFloatSeq"},
17  {"name": "in15", "type": "TimedDoubleSeq"},
18  {"name": "in16", "type": "TimedCharSeq"},
19  {"name": "in17", "type": "TimedBooleanSeq"},
20  {"name": "in18", "type": "TimedOctetSeq"},
21  {"name": "in19", "type": "TimedStringSeq"}
22  ]

Definition at line 464 of file test-template.py.

string test-template.myservice_idl
Initial value:
1 = """
2 typedef sequence<string> EchoList;
3 typedef sequence<float> ValueList;
4 interface MyService
5 {
6  string echo(in string msg);
7  EchoList get_echo_history();
8  void set_value(in float value);
9  float get_value();
10  ValueList get_value_history();
11 };
12 """

Definition at line 23 of file test-template.py.

string test-template.myservice_impl_cpp

Definition at line 82 of file test-template.py.

string test-template.myservice_impl_h

Definition at line 36 of file test-template.py.

list test-template.nums = [0, 1, 2, 10]

Definition at line 599 of file test-template.py.

list test-template.outports
Initial value:
1 = [
2  {"name": "out00", "type": "TimedShort"},
3  {"name": "out01", "type": "TimedLong"},
4  {"name": "out02", "type": "TimedUShort"},
5  {"name": "out03", "type": "TimedULong"},
6  {"name": "out04", "type": "TimedFloat"},
7  {"name": "out05", "type": "TimedDouble"},
8  {"name": "out06", "type": "TimedChar"},
9  {"name": "out07", "type": "TimedBoolean"},
10  {"name": "out08", "type": "TimedOctet"},
11  {"name": "out09", "type": "TimedString"},
12  {"name": "out10", "type": "TimedShortSeq"},
13  {"name": "out11", "type": "TimedLongSeq"},
14  {"name": "out12", "type": "TimedUShortSeq"},
15  {"name": "out13", "type": "TimedULongSeq"},
16  {"name": "out14", "type": "TimedFloatSeq"},
17  {"name": "out15", "type": "TimedDoubleSeq"},
18  {"name": "out16", "type": "TimedCharSeq"},
19  {"name": "out17", "type": "TimedBooleanSeq"},
20  {"name": "out18", "type": "TimedOctetSeq"},
21  {"name": "out19", "type": "TimedStringSeq"}
22  ]

Definition at line 487 of file test-template.py.

dictionary test-template.params
Initial value:
1 = {
2  "inports": inports,
3  "outports": outports,
4  "svcports": svcports,
5  "configs": configs
6  }

Definition at line 601 of file test-template.py.

string test-template.rtm_config

Definition at line 247 of file test-template.py.

string test-template.sh_footer
Initial value:
1 = """
2 
3 for tmpname in *.tmp
4 do
5  fname=`basename $tmpname .tmp`
6  cp -f $tmpname $fname
7 done
8 
9 echo '#include "VectorConvert.h"' >> [name].h
10 
11 make -f Makefile.*
12 """

Definition at line 413 of file test-template.py.

string test-template.sh_header
Initial value:
1 = """\
2 #!/bin/sh
3 export PYTHONPATH=../../:../../py_helper
4 export RTM_ROOT=../../../../
5 export PATH=./:../../:../../../rtm-skelwrapper:$PATH
6 
7 rm -rf *.cpp *.h *.hh *.cc *.sln *.vcproj *.vsprops *.yaml
8 rm -rf copyprops.bat Makefile.* README.*
9 rm -rf [name] [name]Comp
10 
11 """

Definition at line 392 of file test-template.py.

list test-template.svcports

Definition at line 547 of file test-template.py.

test-template.t = TestGen([0,1,5],[0,1,5],[0,1,5],[0,1,5])

Definition at line 755 of file test-template.py.

string test-template.vector_convert_h
Initial value:
1 = """\
2 // -*- C++ -*-
3 
4 #include <istream>
5 #include <ostream>
6 #include <vector>
7 #include <string>
8 #include <coil/stringutil.h>
9 
10 template<typename T>
11 std::istream& operator>>(std::istream& is, std::vector<T>& v)
12 {
13  std::string s;
14  coil::vstring sv;
15  is >> s;
16  sv = coil::split(s ,",");
17  v.resize(sv.size());
18  for (int i(0), len(sv.size()); i < len; ++i)
19  {
20  T tv;
21  if (coil::stringTo(tv, sv[i].c_str()))
22  {
23  v[i] = tv;
24  }
25  }
26  return is;
27 }
28 """

Definition at line 194 of file test-template.py.

string test-template.yourservice_idl
Initial value:
1 = """
2 interface YourService {
3  void func0();
4 
5  void func1(in short val);
6  void func2(inout short val);
7  void func3(out short val);
8 
9  void func4(in long val);
10  void func5(inout long val);
11  void func6(out long val);
12 
13  void func7(in float val);
14  void func8(inout float val);
15  void func9(out float val);
16 
17  void func10(in double val);
18  void func11(inout double val);
19  void func12(out double val);
20 
21 };
22 """

Definition at line 171 of file test-template.py.



openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Jun 10 2019 14:08:05