forked from expertisesolutions/tctautomated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
155 lines (120 loc) · 6.57 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
TCT automated: Template-based Eolian TCT tests generator
===============================================================================
TCT automated is a Python Script using the Testgen and Pyolian to generate TCT
tests rendering templates with custom files, this can generate TCT tests to
Emono eolian CSharp.
Installation
============
You will need to use the `EFL_DIR` environment variable to TCTautomated can
find Testgen classes and other eolian files
Other requirement is that **the source EFL tree must be already built** (not
installed) because pyolian search the eolian .so/.dll inside the source tree.
If you built the efl tree in a custom location (fe, you build out-of-tree) you
can tell pyolian where to find the built eolian .so files using the
`EOLIAN_SO_DIR` environment variable.
Optionally you can use `EFL_DIR` environment variable to define the efl root path
Command line usage
==================
The simplest way to use the generator is from the command line, using the
`autogen.py` command, the `--help` option state:
usage: autogen.py [-h] [--name NAME] [--dir DIR] [--efl EFL]
TCTautomated.
optional arguments:
-h, --help show this help message and exit
--name NAME, -n NAME Suite name and where look custom files.
--dir DIR, -d DIR Destination path to write generated files.
--efl EFL, -e EFL Efl Root Path
How customise a Generated Test
==============================
TCTautomate use the filesystem to find custom files if you need customise a test,
add/write follow files in src/tests:
Suite custom files
* `./<suitename>/`
|-> <suitename>_custom.cs #add include files, functions or structs
|-> <suitename>_init.cs #add code in SUITE_INIT
|-> <suitename>_shutdown.cs #add code in SUITE_SHUTDOWN
Class Test case custom files
* `./<suitename>/<class_name>/` #use lowercase and `_` separator
|-> custom.cs #add include files, functions or structs
|-> init.cs #add default way to create the object of this class
|-> shutdown.cs #add default way to free the object
|-> criteria_custom.cs #change CRITERIA in constructor test
Funtions Tests
- Tests methods custom files
* `./<suitename>/<class_name>/<method_name>/`
|-> arg_init.cs #initialize method arguments (arg_<argument_name>)
|-> init.cs #add how to create the object (replace default)
|-> arg_shutdown.cs #free arguments
|-> shutdown.cs #add how to free the object (replace default)
|-> criteria_custom.cs #change CRITERIA in this method test
- Tests properties custom files
* `./<suitename>/<class_name>/<property_name>/`
| -- Property Get --
|-> arg_get_init.cs #initialize property get arguments (arg_<argument_name>)
|-> get_init.cs #how to create the object (replace default)
|-> arg_get_shutdown.cs #free arguments
|-> get_shutdown.cs #how to free the object (replace default)
|-> get_criteria_custom.cs #change get property CRITERIA
| -- Property Set --
|-> arg_set_init.cs #initialize propety set arguments (arg_<argument_name>)
|-> set_init.cs #how to create the object (replace default)
|-> arg_set_shutdown.cs #free arguments
|-> set_shutdown.cs #how to free the object (replace default)
|-> set_criteria_custom.cs #change set property CRITERIA
Event Tests
- Tests Events custom files
* `./<suitename>/<class_name>/<event_name>/`
|-> init.cs #add how to initialize the objects
|-> custom.cs #add customizations in callback
|-> shutdown.cs #add shutdown or any method to call the event
Criteria Special criteria custom Tests
- Criteria MAE tests custom files
* `./<suitename>/<class_name>/<function_name>/`
|-> irange_init.cs #initialize in range MAR custom args (or use default value)
|-> orange_init.cs #initialize out of range MAR custom args (or use MaxValue)
- Criteria PMAX/PMIN tests custom files
* `./<suitename>/<class_name>/<function_name>/`
|-> pmax_init.cs #initialize PMAX custom args (or use MinValue)
|-> pmin_init.cs #initialize PMIN custom args (or use MaxValue)
- Criteria PAM/PBM tests custom files
* `./<suitename>/<class_name>/<function_name>/`
|-> pam_init.cs #initialize PAM custom args (or use MinValue)
|-> pbm_init.cs #initialize PBM custom args (or use MaxValue)
- Criteria PEX/MEX tests custom files
* `./<suitename>/<class_name>/<function_name>/`
|-> mex_init.cs #initialize MEX custom init
|-> mex_shutdown.cs #initialize MEX custom shutdown
|-> mex_arg_init.cs #initialize MEX custom args
|-> mex_arg_shutdown.cs #initialize MEX custom args shutdown
|-> pexg_init.cs #initialize PEX GET custom init
|-> pexg_shutdown.cs #initialize PEX GET custom shutdown
|-> pexg_arg_init.cs #initialize PEX GET custom args
|-> pexg_arg_shutdown.cs #initialize PEX GET custom args shutdown
|-> pexs_init.cs #initialize PEX SET custom init
|-> pexs_shutdown.cs #initialize PEX SET custom shutdown
|-> pexs_arg_init.cs #initialize PEX SET custom args
|-> pexs_arg_shutdown.cs #initialize PEX SET custom args shutdown
to make some custom files you only need a code using:
`parent` -> default name of parent object
`obj` -> default name of current object
`arg_<name>` -> replace <name> with functions arguments name
you can use *custom.cs (suite or class) to add specilized code
Some class or function test don't need a test in some Suite, you can disable test generated
of it with a blank file as following:
#use lowercase and `_` as separator
`/<suitename>/<class_name>` #don't generate test for <class_name>
`/<suitename>/<class_name>/method_name` #don't generate test for <method_name>
`/<suitename>/<class_name>/<property_name>` #don't generate test for this property
`/<suitename>/<class_name>/<property_name>_get` #don't generate test for this property get
`/<suitename>/<class_name>/<property_name>_set` #don't generate test for this property set
Where to find more info
=======================
* read the Pyolian README file in EFL scripts
* read the eolian.py file (it declare the full eolian API)
* read the generator.py file (it's super simple)
* read the original [pyratemp docs](https://www.simple-is-better.org/template/pyratemp.html)
Note
====
This markdown file is mirrored in efl src tree (src/scripts/pyolian) and in
phab wiki (phab.enlightenment.org/w/pyolian). Don't forget to update the other
if you change one!