Classes | Functions | Variables
test-template Namespace Reference

Classes

class  TestGen

Functions

def _mkdir

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
tuple 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:
00001 """
00002 
00003 call copyprops.bat
00004 for %%x in (*.tmp) do copy /y %%x %%~nx
00005 
00006 echo #include "VectorConvert.h" >> [name].h
00007 
00008 """

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

string test-template::bat_header
Initial value:
00001 """\
00002 @set PATH="%RTM_ROOT%\\utils\\rtc-template";%PATH%
00003 @set PYTHONPATH="%RTM_ROOT%\\utils\\rtc-template"
00004 
00005 del /F /Q *.cpp *.h *.hh *.cc *.sln *.vcproj *.vsprops *.yaml
00006 del /F /Q copyprops.bat Makefile.* README.* 
00007 
00008 rmdir /Q /S [name]
00009 
00010 rmdir /Q /S [name]Comp
00011 
00012 """

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

string test-template::build_sh
Initial value:
00001 """\
00002 #!/bin/sh
00003 
00004 [for proj in projects]
00005 cd [proj] 
00006 sh gen.sh
00007 #make -f Makefile.[proj] 
00008 if test -f [proj]Comp; then
00009   echo [proj]: OK >> ../build_status
00010 else
00011   echo [proj]: NG >> ../build_status
00012 fi
00013 cd ..
00014 [endfor]
00015 """

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

string test-template::build_vc8_bat
Initial value:
00001 """\
00002 @set PATH="C:\\Program Files\\Microsoft Visual Studio 8\\VC\\vcpackages";%PATH%
00003 
00004 [for proj in projects]
00005 cd [proj] 
00006 call gen.bat
00007 vcbuild [proj]_vc8.sln
00008 cd ..
00009 [endfor]
00010 """

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

string test-template::build_vc9_bat
Initial value:
00001 """\
00002 @set PATH="C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcpackages";%PATH%
00003 
00004 [for proj in projects]
00005 cd [proj] 
00006 call gen.bat
00007 vcbuild [proj]_vc9.sln
00008 cd ..
00009 [endfor]
00010 """

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:
00001 """\
00002 rtc-template -bcxx
00003     --module-name=[name] --module-desc="Test RTC for rtc-template"
00004     --module-version=1.0.0 --module-vendor=AIST --module-category=Test
00005     --module-comp-type=DataFlowComponent --module-act-type=SPORADIC
00006     --module-max-inst=10
00007 [for ip in inports]
00008     --inport="[ip.name]:[ip.type]"
00009 [endfor]
00010 
00011 [for op in outports]
00012     --outport="[op.name]:[op.type]"
00013 [endfor]
00014 
00015 [for sp in svcports]
00016     --[sp.direction]="[sp.port_name]:[sp.inst_name]:[sp.type]"
00017     --[sp.direction]-idl="[sp.idl_file]"
00018 [endfor]
00019 
00020 [for cf in configs]
00021     --config="[cf.name]:[cf.type]:[cf.default]"
00022 [endfor]
00023 """

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

list test-template::inports
Initial value:
00001 [
00002     {"name": "in00", "type": "TimedShort"},
00003     {"name": "in01", "type": "TimedLong"},
00004     {"name": "in02", "type": "TimedUShort"},
00005     {"name": "in03", "type": "TimedULong"},
00006     {"name": "in04", "type": "TimedFloat"},
00007     {"name": "in05", "type": "TimedDouble"},
00008     {"name": "in06", "type": "TimedChar"},
00009     {"name": "in07", "type": "TimedBoolean"},
00010     {"name": "in08", "type": "TimedOctet"},
00011     {"name": "in09", "type": "TimedString"},
00012     {"name": "in10", "type": "TimedShortSeq"},
00013     {"name": "in11", "type": "TimedLongSeq"},
00014     {"name": "in12", "type": "TimedUShortSeq"},
00015     {"name": "in13", "type": "TimedULongSeq"},
00016     {"name": "in14", "type": "TimedFloatSeq"},
00017     {"name": "in15", "type": "TimedDoubleSeq"},
00018     {"name": "in16", "type": "TimedCharSeq"},
00019     {"name": "in17", "type": "TimedBooleanSeq"},
00020     {"name": "in18", "type": "TimedOctetSeq"},
00021     {"name": "in19", "type": "TimedStringSeq"}
00022     ]

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

string test-template::myservice_idl
Initial value:
00001 """
00002 typedef sequence<string> EchoList;
00003 typedef sequence<float> ValueList;
00004 interface MyService
00005 {
00006   string echo(in string msg);
00007   EchoList get_echo_history();
00008   void set_value(in float value);
00009   float get_value();
00010   ValueList get_value_history();
00011 };
00012 """

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:
00001 [
00002     {"name": "out00", "type": "TimedShort"},
00003     {"name": "out01", "type": "TimedLong"},
00004     {"name": "out02", "type": "TimedUShort"},
00005     {"name": "out03", "type": "TimedULong"},
00006     {"name": "out04", "type": "TimedFloat"},
00007     {"name": "out05", "type": "TimedDouble"},
00008     {"name": "out06", "type": "TimedChar"},
00009     {"name": "out07", "type": "TimedBoolean"},
00010     {"name": "out08", "type": "TimedOctet"},
00011     {"name": "out09", "type": "TimedString"},
00012     {"name": "out10", "type": "TimedShortSeq"},
00013     {"name": "out11", "type": "TimedLongSeq"},
00014     {"name": "out12", "type": "TimedUShortSeq"},
00015     {"name": "out13", "type": "TimedULongSeq"},
00016     {"name": "out14", "type": "TimedFloatSeq"},
00017     {"name": "out15", "type": "TimedDoubleSeq"},
00018     {"name": "out16", "type": "TimedCharSeq"},
00019     {"name": "out17", "type": "TimedBooleanSeq"},
00020     {"name": "out18", "type": "TimedOctetSeq"},
00021     {"name": "out19", "type": "TimedStringSeq"}
00022     ]

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

dictionary test-template::params
Initial value:
00001 {
00002     "inports": inports,
00003     "outports": outports,
00004     "svcports": svcports,
00005     "configs": configs
00006     }

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:
00001 """
00002 
00003 for tmpname in *.tmp
00004 do
00005     fname=`basename $tmpname .tmp`
00006     cp -f $tmpname $fname
00007 done
00008 
00009 echo '#include "VectorConvert.h"' >> [name].h
00010 
00011 make -f Makefile.*
00012 """

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

string test-template::sh_header
Initial value:
00001 """\
00002 #!/bin/sh
00003 export PYTHONPATH=../../:../../py_helper
00004 export RTM_ROOT=../../../../
00005 export PATH=./:../../:../../../rtm-skelwrapper:$PATH
00006 
00007 rm -rf *.cpp *.h *.hh *.cc *.sln *.vcproj *.vsprops *.yaml
00008 rm -rf copyprops.bat Makefile.* README.*
00009 rm -rf [name] [name]Comp
00010 
00011 """

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

list test-template::svcports

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

tuple 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:
00001 """\
00002 // -*- C++ -*-
00003 
00004 #include <istream>
00005 #include <ostream>
00006 #include <vector>
00007 #include <string>
00008 #include <coil/stringutil.h>
00009 
00010 template<typename T>
00011 std::istream& operator>>(std::istream& is, std::vector<T>& v)
00012 {
00013   std::string s;
00014   coil::vstring sv;
00015   is >> s;
00016   sv = coil::split(s ,",");
00017   v.resize(sv.size());
00018   for (int i(0), len(sv.size()); i < len; ++i)
00019     {
00020       T tv;
00021       if (coil::stringTo(tv, sv[i].c_str()))
00022         {
00023           v[i] = tv;
00024         }
00025     }
00026   return is;
00027 }
00028 """

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

string test-template::yourservice_idl
Initial value:
00001 """
00002 interface YourService {
00003   void func0();
00004 
00005   void func1(in short val);
00006   void func2(inout short val);
00007   void func3(out short val);
00008 
00009   void func4(in long val);
00010   void func5(inout long val);
00011   void func6(out long val);
00012 
00013   void func7(in float val);
00014   void func8(inout float val);
00015   void func9(out float val);
00016 
00017   void func10(in double val);
00018   void func11(inout double val);
00019   void func12(out double val);
00020 
00021 };
00022 """

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



openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Aug 27 2015 14:16:42