summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Lira <larry@expertisesolutions.com.br>2018-09-04 20:47:23 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-06-10 11:58:10 -0300
commit7f068211069b0f9d5f87610eaf9170b977604775 (patch)
treec49c69a45c8536f51758d8befbd7c50d90f1288c
parent6e048a4069e0d938f8e678126385b40331e84f2e (diff)
eolian: Added Eolian test generatordevs/felipealmeida/tctautomated
The test generator allows templates to be used to generate boilerplate for unit tests
-rw-r--r--src/Makefile.am2
-rw-r--r--src/Makefile_Automated.am309
-rw-r--r--src/scripts/pyolian/eolian.py2
-rw-r--r--src/scripts/pyolian/eolian_lib.py1
-rw-r--r--src/scripts/pyolian/pyratemp.py2
-rw-r--r--src/scripts/testgen/README.md146
-rw-r--r--src/scripts/testgen/__init__.py0
-rw-r--r--src/scripts/testgen/ekeys.py239
-rw-r--r--src/scripts/testgen/suitegen.py197
-rwxr-xr-xsrc/scripts/testgen/testgen.py116
-rw-r--r--src/scripts/testgen/testgenerator.c.template177
-rw-r--r--src/scripts/testgen/testgenerator.cs.template113
-rw-r--r--src/tests/automated/ecore_audio_custom.c3
-rw-r--r--src/tests/automated/ecore_audio_init.c2
-rw-r--r--src/tests/automated/ecore_audio_out/input_attach/arg_init.c1
-rw-r--r--src/tests/automated/ecore_audio_out/input_detach/arg_init.c1
-rw-r--r--src/tests/automated/ecore_audio_out_wasapi/init.c3
-rw-r--r--src/tests/automated/ecore_audio_out_wasapi/shutdown.c3
-rw-r--r--src/tests/automated/ector_custom.c3
-rw-r--r--src/tests/automated/ector_init.c1
-rw-r--r--src/tests/automated/ector_renderer_cairo_shape/init.c2
-rw-r--r--src/tests/automated/ector_shutdown.c1
-rw-r--r--src/tests/automated/edje_custom.c1
-rw-r--r--src/tests/automated/edje_init.c2
-rw-r--r--src/tests/automated/edje_shutdown.c2
-rw-r--r--src/tests/automated/efl_canvas_layout_part/init.c9
-rw-r--r--src/tests/automated/efl_canvas_layout_part_box/init.c9
-rw-r--r--src/tests/automated/efl_canvas_layout_part_external/init.c8
-rw-r--r--src/tests/automated/efl_canvas_layout_part_swallow/init.c8
-rw-r--r--src/tests/automated/efl_canvas_layout_part_table/init.c8
-rw-r--r--src/tests/automated/efl_canvas_layout_part_text/init.c8
-rw-r--r--src/tests/automated/efl_canvas_video/init.c2
-rw-r--r--src/tests/automated/efl_loop/begin/init.c9
-rw-r--r--src/tests/automated/efl_loop/begin/shutdown.c3
-rw-r--r--src/tests/automated/efl_loop/custom.c5
-rw-r--r--src/tests/automated/efl_loop/timeout/arg_init.c1
-rw-r--r--src/tests/automated/efl_text_markup_util/init.c1
-rw-r--r--src/tests/automated/eio_custom.c1
-rw-r--r--src/tests/automated/eio_init.c1
-rw-r--r--src/tests/automated/eio_shutdown.c1
-rw-r--r--src/tests/automated/eldbus_init.c1
-rw-r--r--src/tests/automated/eldbus_shutdown.c1
-rw-r--r--src/tests/automated/emotion_custom.c2
-rw-r--r--src/tests/automated/emotion_init.c3
-rw-r--r--src/tests/automated/emotion_shutdown.c4
-rw-r--r--src/tests/automated/evas_custom.c1
46 files changed, 1414 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 9675fc193b..f1e013645d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -87,6 +87,8 @@ include Makefile_Elua.am
87 87
88include Makefile_Wayland_Protocols.am 88include Makefile_Wayland_Protocols.am
89 89
90include Makefile_Automated.am
91
90if HAVE_JS 92if HAVE_JS
91AM_V_CP = $(am__v_CP_@AM_V@) 93AM_V_CP = $(am__v_CP_@AM_V@)
92am__v_CP_ = $(am__v_CP_@AM_DEFAULT_V@) 94am__v_CP_ = $(am__v_CP_@AM_DEFAULT_V@)
diff --git a/src/Makefile_Automated.am b/src/Makefile_Automated.am
new file mode 100644
index 0000000000..77115b2443
--- /dev/null
+++ b/src/Makefile_Automated.am
@@ -0,0 +1,309 @@
1
2if EFL_ENABLE_TESTS
3
4#AM_TESTS_ENVIRONMENT += EOLIAN_SO_DIR='$(top_builddir)/src/lib/eolian/.libs/'; export EOLIAN_SO_DIR;
5#gen_eolian_dir = EOLIAN_SO_DIR='$(top_builddir)/src/lib/eolian/.libs/'
6TEST_GEN = $(top_srcdir)/src/scripts/testgen/testgen.py
7
8#### ecore ####
9#ecore_automated_source = tests/automated/ecore_suite_automated.c
10#ecore_automated_suite = $(top_builddir)/src/$(ecore_automated_source)
11#$(ecore_automated_source):
12# $(TEST_GEN) automated ecore $(top_builddir)/src/$@ $(ecore_eolian_files)
13#
14#check_PROGRAMS += tests/automated/ecore_suite_automated
15#TESTS += tests/automated/ecore_suite_automated
16#
17#tests_automated_ecore_suite_automated_SOURCE = $(ecore_automated_source)
18#tests_automated_ecore_suite_automated_CPPFLAGS = $(tests_ecore_ecore_suite_CPPFLAGS) \
19#-I$(top_srcdir)/src/tests \
20#@ELEMENTARY_CFLAGS@
21#tests_automated_ecore_suite_automated_LDADD = $(tests_ecore_ecore_suite_LDADD) @USE_ELEMENTARY_LIBS@
22
23#### ecore_audio ####
24ecore_audio_automated_source = tests/automated/ecore_audio_suite_automated.c
25ecore_audio_automated_suite = $(top_builddir)/src/$(ecore_audio_automated_source)
26$(ecore_audio_automated_source):
27 $(TEST_GEN) automated ecore_audio $(top_builddir)/src/$@ $(ecore_audio_eolian_files)
28
29check_PROGRAMS += tests/automated/ecore_audio_suite_automated
30TESTS += tests/automated/ecore_audio_suite_automated
31
32tests_automated_ecore_audio_suite_automated_SOURCE = $(ecore_audio_automated_source)
33tests_automated_ecore_audio_suite_automated_CPPFLAGS = $(tests_ecore_ecore_suite_CPPFLAGS) \
34-I$(top_srcdir)/src/tests \
35@ECORE_AUDIO_CFLAGS@ \
36@ECORE_FILE_CFLAGS@ \
37@ELEMENTARY_CFLAGS@
38tests_automated_ecore_audio_suite_automated_LDADD = $(tests_ecore_ecore_suite_LDADD) @USE_ELEMENTARY_LIBS@
39
40#### ecore_con ####
41#ecore_con_automated_source = tests/automated/ecore_con_suite_automated.c
42#ecore_con_automated_suite = $(top_builddir)/src/$(ecore_con_automated_source)
43#$(ecore_con_automated_source):
44# $(TEST_GEN) automated ecore_con $(top_builddir)/src/$@ $(ecore_eolian_files)
45#
46#check_PROGRAMS += tests/automated/ecore_con_suite_automated
47#TESTS += tests/automated/ecore_con_suite_automated
48#
49#tests_automated_ecore_con_suite_automated_SOURCE = $(ecore_automated_source)
50#tests_automated_ecore_con_suite_automated_CPPFLAGS = $(tests_ecore_con_ecore_con_suite_CPPFLAGS) \
51#-I$(top_srcdir)/src/tests \
52#@ELEMENTARY_CFLAGS@
53#tests_automated_ecore_con_suite_automated_LDADD = $(tests_ecore_con_ecore_con_suite_LDADD) @USE_ELEMENTARY_LIBS@
54#tests_automated_ecore_con_suite_automated_DEPENDENCIES = $(tests_ecore_con_ecore_con_suite_DEPENDENCIES)
55
56#### ector ####
57ector_automated_source = tests/automated/ector_suite_automated.c
58ector_automated_suite = $(top_builddir)/src/$(ector_automated_source)
59$(ector_automated_source):
60# $(TEST_GEN) automated ector $(top_builddir)/src/$@ $(ector_eolian_files_generic)
61 $(TEST_GEN) automated ector $(top_builddir)/src/$@ $(ector_eolian_files)
62
63check_PROGRAMS += tests/automated/ector_suite_automated
64TESTS += tests/automated/ector_suite_automated
65
66tests_automated_ector_suite_automated_SOURCE = $(ector_automated_source)
67tests_automated_ector_suite_automated_CPPFLAGS = $(tests_ector_suite_ector_suite_CPPFLAGS) \
68-I$(top_srcdir)/src/tests \
69@ELEMENTARY_CFLAGS@
70tests_automated_ector_suite_automated_LDADD = $(tests_ector_suite_ector_suite_LDADD) @USE_ECORE_LIBS@
71tests_automated_ector_suite_automated_DEPENDENCIES = @USE_ECTOR_INTERNAL_LIBS@
72
73#### edje ####
74edje_automated_source = tests/automated/edje_suite_automated.c
75edje_automated_suite = $(top_builddir)/src/$(edje_automated_source)
76$(edje_automated_source):
77 $(TEST_GEN) automated edje $(top_builddir)/src/$@ $(edje_eolian_files)
78
79check_PROGRAMS += tests/automated/edje_suite_automated
80TESTS += tests/automated/edje_suite_automated
81
82tests_automated_edje_suite_automated_SOURCE = $(edje_automated_source)
83tests_automated_edje_suite_automated_CPPFLAGS = $(tests_edje_edje_suite_CPPFLAGS) \
84-I$(top_srcdir)/src/tests \
85@ELEMENTARY_CFLAGS@
86tests_automated_edje_suite_automated_LDADD = $(tests_edje_edje_suite_LDADD) @USE_ECORE_LIBS@
87tests_automated_edje_suite_automated_DEPENDENCIES = @USE_EDJE_INTERNAL_LIBS@
88
89#### efl ####
90efl_automated_source = tests/automated/efl_suite_automated.c
91efl_automated_suite = $(top_builddir)/src/$(efl_automated_source)
92$(efl_automated_source):
93 $(TEST_GEN) automated efl $(top_builddir)/src/$@ $(efl_eolian_files)
94
95check_PROGRAMS += tests/automated/efl_suite_automated
96TESTS += tests/automated/efl_suite_automated
97
98tests_automated_efl_suite_automated_SOURCE = $(efl_automated_source)
99tests_automated_efl_suite_automated_CPPFLAGS = $(tests_efl_efl_suite_CPPFLAGS) \
100-I$(top_srcdir)/src/tests \
101@ELEMENTARY_CFLAGS@
102tests_automated_efl_suite_automated_LDADD = \
103@CHECK_LIBS@ \
104@EFL_LIBS@ \
105@USE_EFL_LIBS@ \
106@USE_ECORE_LIBS@
107tests_automated_efl_suite_automated_DEPENDENCIES = \
108@USE_EFL_INTERNAL_LIBS@ \
109@USE_ECORE_INTERNAL_LIBS@
110
111
112##### eio ####
113eio_automated_source = tests/automated/eio_suite_automated.c
114eio_automated_suite = $(top_builddir)/src/$(eio_automated_source)
115$(eio_automated_source):
116 $(TEST_GEN) automated eio $(top_builddir)/src/$@ $(eio_eolian_files)
117
118check_PROGRAMS += tests/automated/eio_suite_automated
119TESTS += tests/automated/eio_suite_automated
120
121tests_automated_eio_suite_automated_SOURCE = $(eio_automated_source)
122tests_automated_eio_suite_automated_CPPFLAGS = $(tests_eio_eio_suite_CPPFLAGS) \
123-I$(top_srcdir)/src/tests \
124@ELEMENTARY_CFLAGS@
125tests_automated_eio_suite_automated_LDADD = $(tests_eio_eio_suite_LDADD) \
126@USE_ECORE_LIBS@
127tests_automated_eio_suite_automated_DEPENDENCIES = \
128@USE_EIO_INTERNAL_LIBS@
129
130#### eldbus ####
131eldbus_automated_source = tests/automated/eldbus_suite_automated.c
132eldbus_automated_suite = $(top_builddir)/src/$(eldbus_automated_source)
133$(eldbus_automated_source):
134 $(TEST_GEN) automated eldbus $(top_builddir)/src/$@ $(eldbus_eolian_files)
135
136check_PROGRAMS += tests/automated/eldbus_suite_automated
137TESTS += tests/automated/eldbus_suite_automated
138
139tests_automated_eldbus_suite_automated_SOURCE = $(eldbus_automated_source)
140tests_automated_eldbus_suite_automated_CPPFLAGS = $(tests_eldbus_eldbus_suite_CPPFLAGS) \
141-I$(top_srcdir)/src/tests \
142@ELEMENTARY_CFLAGS@
143tests_automated_eldbus_suite_automated_LDADD = $(tests_eldbus_eldbus_suite_LDADD) \
144@USE_ECORE_LIBS@
145tests_automated_eldbus_suite_automated_DEPENDENCIES = @USE_ELDBUS_INTERNAL_LIBS@
146
147#### emotion ####
148emotion_automated_source = tests/automated/emotion_suite_automated.c
149emotion_automated_suite = $(top_builddir)/src/$(emotion_automated_source)
150$(emotion_automated_source):
151 $(TEST_GEN) automated emotion $(top_builddir)/src/$@ $(emotion_eolian_files)
152
153check_PROGRAMS += tests/automated/emotion_suite_automated
154TESTS += tests/automated/emotion_suite_automated
155
156tests_automated_emotion_suite_automated_SOURCE = $(emotion_automated_source)
157tests_automated_emotion_suite_automated_CPPFLAGS = $(tests_emotion_emotion_test_CPPFLAGS) \
158-I$(top_srcdir)/src/tests \
159-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/automated\" \
160@ELEMENTARY_CFLAGS@
161tests_automated_emotion_suite_automated_LDADD = $(tests_emotion_emotion_test_LDADD) \
162@USE_ECORE_LIBS@ \
163@USE_EO_LIBS@ \
164@CHECK_LIBS@
165tests_automated_emotion_suite_automated_DEPENDENCIES = $(tests_emotion_emotion_test_DEPENDENCIES) \
166@USE_EO_INTERNAL_LIBS@
167
168#### eo ####
169eo_automated_source = tests/automated/eo_suite_automated.c
170eo_automated_suite = $(top_builddir)/src/$(eo_automated_source)
171$(eo_automated_source):
172 $(TEST_GEN) automated eo $(top_builddir)/src/$@ $(eo_eolian_files)
173
174check_PROGRAMS += tests/automated/eo_suite_automated
175TESTS += tests/automated/eo_suite_automated
176
177tests_automated_eo_suite_automated_SOURCE = $(eo_automated_source)
178tests_automated_eo_suite_automated_CPPFLAGS = $(tests_eo_eo_suite_CPPFLAGS) \
179-I$(top_srcdir)/src/tests \
180@ELEMENTARY_CFLAGS@
181tests_automated_eo_suite_automated_LDADD = $(tests_eo_eo_suite_LDADD) \
182@USE_ECORE_LIBS@
183tests_automated_eo_suite_automated_DEPENDENCIES = $(tests_eo_eo_suite_DEPENDENCIES)
184
185#### evas ####
186evas_automated_source = tests/automated/evas_suite_automated.c
187evas_automated_suite = $(top_builddir)/src/$(evas_automated_source)
188$(evas_automated_source):
189 $(TEST_GEN) automated evas $(top_builddir)/src/$@ $(evas_eolian_files)
190
191check_PROGRAMS += tests/automated/evas_suite_automated
192TESTS += tests/automated/evas_suite_automated
193
194tests_automated_evas_suite_automated_SOURCE = $(evas_automated_source)
195tests_automated_evas_suite_automated_CPPFLAGS = $(tests_evas_evas_suite_CPPFLAGS) \
196-I$(top_srcdir)/src/tests \
197-I$(top_srcdir)/src/lib/evas/canvas \
198-I$(top_srcdir)/src/lib/evas/include \
199@ELEMENTARY_CFLAGS@
200tests_automated_evas_suite_automated_LDADD = $(tests_evas_evas_suite_LDADD) \
201@USE_ECORE_LIBS@
202tests_automated_evas_suite_automated_DEPENDENCIES = $(tests_evas_evas_suite_DEPENDENCIES)
203
204
205if HAVE_CSHARP
206#### EFL MONO ####
207
208tests_efl_mono_base = \
209 tests/efl_mono/Main.cs \
210 tests/efl_mono/TestUtils.cs
211
212## Mono Ecore ##
213
214mono_ecore_automated_source = tests/automated/ecore_suite_automated.cs
215mono_ecore_automated_bin = tests/automated/efl_mono_ecore$(EXEEXT)
216
217check_PROGRAMS += $(mono_ecore_automated_bin)
218TESTS += $(mono_ecore_automated_bin)
219
220tests_automated_efl_mono_ecore_SOURCE = \
221 $(tests_efl_mono_base) \
222 $(mono_ecore_automated_source)
223
224tests/automated/efl_mono_ecore$(EXEEXT): $(tests_automated_efl_mono_ecore_SOURCE) lib/efl_mono/libefl_mono.dll tests/efl_mono/efl_mono$(EXEEXT).config
225 @rm -f $@
226 $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
227
228$(mono_ecore_automated_source):
229 $(TEST_GEN) automated ecore $(top_builddir)/src/$@ $(filter-out $(ecore_eolian_blacklisted_files:%.eo.cs=%.eo),$(ecore_eolian_files_public))
230
231## Mono Eo ##
232
233mono_eo_automated_source = tests/automated/eo_suite_automated.cs
234mono_eo_automated_bin = tests/automated/efl_mono_eo$(EXEEXT)
235
236check_PROGRAMS += $(mono_eo_automated_bin)
237TESTS += $(mono_eo_automated_bin)
238
239tests_automated_efl_mono_eo_SOURCE = \
240 $(tests_efl_mono_base) \
241 $(mono_eo_automated_source)
242
243tests/automated/efl_mono_eo$(EXEEXT): $(tests_automated_efl_mono_eo_SOURCE) lib/efl_mono/libefl_mono.dll tests/efl_mono/efl_mono$(EXEEXT).config
244 @rm -f $@
245 $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
246
247$(mono_eo_automated_source):
248 $(TEST_GEN) automated eo $(top_builddir)/src/$@ $(filter-out $(eo_eolian_blacklisted_files:%.eo.cs=%.eo),$(eo_eolian_files))
249
250## Mono Efl ##
251
252mono_efl_automated_source = tests/automated/efl_suite_automated.cs
253mono_efl_automated_bin = tests/automated/efl_mono_efl$(EXEEXT)
254
255check_PROGRAMS += $(mono_efl_automated_bin)
256TESTS += $(mono_efl_automated_bin)
257
258tests_automated_efl_mono_efl_SOURCE = \
259 $(tests_efl_mono_base) \
260 $(mono_efl_automated_source)
261
262tests/automated/efl_mono_efl$(EXEEXT): $(tests_automated_efl_mono_efl_SOURCE) lib/efl_mono/libefl_mono.dll tests/efl_mono/efl_mono$(EXEEXT).config
263 @rm -f $@
264 $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
265
266$(mono_efl_automated_source):
267 $(TEST_GEN) automated efl $(top_builddir)/src/$@ $(filter-out $(efl_eolian_blacklisted_files:%.eo.cs=%.eo),$(efl_eolian_files))
268
269## Mono Edje ##
270
271mono_edje_automated_source = tests/automated/edje_suite_automated.cs
272mono_edje_automated_bin = tests/automated/efl_mono_edje$(EXEEXT)
273
274check_PROGRAMS += $(mono_edje_automated_bin)
275TESTS += $(mono_edje_automated_bin)
276
277tests_automated_efl_mono_edje_SOURCE = \
278 $(tests_efl_mono_base) \
279 $(mono_edje_automated_source)
280
281tests/automated/efl_mono_edje$(EXEEXT): $(tests_automated_efl_mono_edje_SOURCE) lib/efl_mono/libefl_mono.dll tests/efl_mono/efl_mono$(EXEEXT).config
282 @rm -f $@
283 $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
284
285$(mono_edje_automated_source):
286 $(TEST_GEN) automated edje $(top_builddir)/src/$@ $(filter-out $(edje_eolian_blacklisted_files:%.eo.cs=%.eo),$(edje_eolian_files))
287
288## Mono Elementary ##
289
290mono_elementary_automated_source = tests/automated/elementary_suite_automated.cs
291mono_elementary_automated_bin = tests/automated/efl_mono_elementary$(EXEEXT)
292
293check_PROGRAMS += $(mono_elementary_automated_bin)
294TESTS += $(mono_elementary_automated_bin)
295
296tests_automated_efl_mono_elementary_SOURCE = \
297 $(tests_efl_mono_base) \
298 $(mono_elementary_automated_source)
299
300tests/automated/efl_mono_elementary$(EXEEXT): $(tests_automated_efl_mono_elementary_SOURCE) lib/efl_mono/libefl_mono.dll tests/efl_mono/efl_mono$(EXEEXT).config
301 @rm -f $@
302 $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
303
304$(mono_elementary_automated_source):
305 $(TEST_GEN) automated elementary $(top_builddir)/src/$@ $(filter-out $(elementary_eolian_blacklisted_files:%.eo.cs=%.eo),$(elm_public_eolian_files))
306
307
308endif
309endif
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index d5c99a1990..482964da49 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -918,7 +918,7 @@ class Function(Object):
918 return Type(c_type) if c_type else None 918 return Type(c_type) if c_type else None
919 919
920 def return_default_value(self, ftye): 920 def return_default_value(self, ftye):
921 c_expr = lib.eolian_function_return_default_value_get(sel._obj, ftype) 921 c_expr = lib.eolian_function_return_default_value_get(self._obj, ftype)
922 return Expression(c_expr) if c_expr else None 922 return Expression(c_expr) if c_expr else None
923 923
924 def return_documentation(self, ftype): 924 def return_documentation(self, ftype):
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index d8ee7f04d9..bddf9ff74b 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -14,6 +14,7 @@ root_path = os.path.abspath(os.path.join(script_path, '..', '..', '..'))
14search_in = [ 14search_in = [
15 os.path.join(root_path, 'src', 'lib', 'eolian', '.libs'), 15 os.path.join(root_path, 'src', 'lib', 'eolian', '.libs'),
16 os.path.join(root_path, 'build', 'src', 'lib', 'eolian'), 16 os.path.join(root_path, 'build', 'src', 'lib', 'eolian'),
17 os.path.join(root_path, 'build', 'src', 'lib', 'eolian', '.libs'),
17] 18]
18 19
19if 'EOLIAN_SO_DIR' in os.environ: 20if 'EOLIAN_SO_DIR' in os.environ:
diff --git a/src/scripts/pyolian/pyratemp.py b/src/scripts/pyolian/pyratemp.py
index c28e260b4b..1ddfb773fc 100644
--- a/src/scripts/pyolian/pyratemp.py
+++ b/src/scripts/pyolian/pyratemp.py
@@ -846,6 +846,8 @@ class EvalPseudoSandbox:
846 "complex" : builtins.complex, 846 "complex" : builtins.complex,
847 "dict" : builtins.dict, 847 "dict" : builtins.dict,
848 "enumerate" : builtins.enumerate, 848 "enumerate" : builtins.enumerate,
849 "filter" : builtins.filter,
850 "next" : builtins.next,
849 "float" : builtins.float, 851 "float" : builtins.float,
850 "int" : builtins.int, 852 "int" : builtins.int,
851 "list" : builtins.list, 853 "list" : builtins.list,
diff --git a/src/scripts/testgen/README.md b/src/scripts/testgen/README.md
new file mode 100644
index 0000000000..4531f636db
--- /dev/null
+++ b/src/scripts/testgen/README.md
@@ -0,0 +1,146 @@
1
2Testgen: Template-based Eolian tests generator
3===============================================================================
4
5Testgen is a Python Script using the Pyolian to generate tests rendering
6templates with custom files, this can be a easy way to expand the
7API test coveraged.
8
9Testgen can generate tests C and to other bingings languages only
10adding new language specialized templates.
11
12Installation
13============
14
15There is nothing to install to use the generator, everything is included in
16the efl source tree and it is intended to work directly inside the tree,
17usually at efl tests compilation time (make check).
18
19The only requirement is that **the source tree must be already built** (not
20installed) because pyolian search the eolian .so/.dll inside the source tree.
21
22If you built the efl tree in a custom location (fe, you build out-of-tree) you
23can tell pyolian where to find the built eolian .so files using the
24`EOLIAN_SO_DIR` environment variable.
25
26
27Command line usage
28==================
29
30The simplest way to use the generator is from the command line, using the
31`src/scripts/testgen/testgen.py` command, the `--help` option state:
32
33```
34usage: testgen.py [-h] testname suitename filename [eofiles [eofiles ...]]
35
36Eolian Test Generator.
37
38positional arguments:
39 testname The Test Name used to find custom and template files. (REQUIRED)
40 suitename The Suite Name used to find custom files. (REQUIRED)
41 filename Generated test file destination. (REQUIRED)
42 eofiles The Eolian Files to use.
43
44optional arguments:
45 -h, --help show this help message and exit
46```
47Use .c extension in <filename> to generate C tests or .cs to CSharp
48
49To test this generator in `src/scripts/testgen` you can run:
50```
51./testgen.py automated efl efl_automated_test.c efl_loop.eo
52```
53This will rendere the automated tests using files in `src/tests/automated` with
54suite name `efl_automated` and with Efl.Loop Class as Test Case
55`efl_automated_efl_loop_test`
56
57or run:
58```
59./testgen.py automated eio eio_automated_test.c eio_sentry.eo eio_model.eo
60```
61This will rendere with suite name `eio_automated` and with Eio.Sentry and
62Eio.Model Class as Test Cases `eio_automated_eio_sentry_test` and
63`eio_automated_eio_model_test`
64
65
66How customise a Generated Test
67==============================
68
69Testgen use the filesystem to find custom files if you need customise a test,
70add/write follow files in src/tests:
71
72 Suite custom files
73 * `src/test/<testname>/`
74 |-> <suitename>_custom.c #add include files, functions or structs
75 |-> <suitename>_init.c #add code in SUITE_INIT
76 |-> <suitename>_shutdown.c #add code in SUITE_SHUTDOWN
77
78 Class Test case custom files
79 * `src/test/<testname>/<class_name>/` #use lowercase and `_` separator
80 |-> custom.c #add include files, functions or structs
81 |-> init.c #add default way to create the object of this class
82 |-> shutdown.c #add default way to free the object
83
84Funtions Tests
85- Tests methodes custom files
86 * `src/test/<testname>/<class_name>/<method_name>`
87 |-> arg_init.c #initialize method arguments (arg_<argument_name>)
88 |-> init.c #add how to create the object (replace default)
89 |-> arg_shutdown.c #free arguments
90 |-> shutdown.c #add how to free the object (replace default)
91
92- Tests properties custom files
93 * `src/test/<testname>/<class_name>/<property_name>`
94 | -- Property Get --
95 |-> arg_get_init.c #initialize property get arguments (arg_<argument_name>)
96 |-> get_init.c #how to create the object (replace default)
97 |-> arg_get_shutdown.c #free arguments
98 |-> get_shutdown.c #how to free the object (replace default)
99 | -- Property Set --
100 |-> arg_set_init.c #initialize propety set arguments (arg_<argument_name>)
101 |-> set_init.c #how to create the object (replace default)
102 |-> arg_set_shutdown.c #free arguments
103 |-> set_shutdown.c #how to free the object (replace default)
104
105Event Tests
106- Tests Events custom files
107 * `src/test/<testname>/<class_name>/<event_name>/`
108 |-> init.cs #add how to initialize the objects
109 |-> custom.cs #add customizations in callback
110 |-> shutdown.cs #add shutdown or any method to call the event
111
112to make some custom files you only need a code using:
113 `parent` -> default name of parent object defined as `Eo *`
114 `obj` -> default name of current object
115 `arg_<name>` -> replace <name> with functions arguments name
116
117you can use custom.c (suite or class) to add specilized code, structs and callbacks
118
119-- Use `*.cs` to Emono/CSharp generated code --
120
121Some class or function test don't need a test in some Suite, you can disable test generated
122of it with a blank file as following:
123
124use lowercase and `_` as separator
125`src/test/<testname>/<class_name>` #don't generate test for <class_name>
126`src/test/<testname>/<class_name>/method_name` #don't generate test for <method_name>
127`src/test/<testname>/<class_name>/<property_name>` #don't generate test for this property
128`src/test/<testname>/<class_name>/<property_name>_get` #don't generate test for this property get
129`src/test/<testname>/<class_name>/<property_name>_set` #don't generate test for this property set
130
131
132Where to find more info
133=======================
134
135 * read the Pyolian README file in EFL scripts
136 * read the eolian.py file (it declare the full eolian API)
137 * read the generator.py file (it's super simple)
138 * read the original [pyratemp docs](https://www.simple-is-better.org/template/pyratemp.html)
139
140
141Note
142====
143
144This markdown file is mirrored in efl src tree (src/scripts/pyolian) and in
145phab wiki (phab.enlightenment.org/w/pyolian). Don't forget to update the other
146if you change one!
diff --git a/src/scripts/testgen/__init__.py b/src/scripts/testgen/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/scripts/testgen/__init__.py
diff --git a/src/scripts/testgen/ekeys.py b/src/scripts/testgen/ekeys.py
new file mode 100644
index 0000000000..211dfb1651
--- /dev/null
+++ b/src/scripts/testgen/ekeys.py
@@ -0,0 +1,239 @@
1#!/usr/bin/env python3
2# encoding: utf-8
3from enum import IntEnum
4
5
6class Function_List_Type(IntEnum):
7 INHERITIS = 1
8 INHERITIS_FULL = 2
9 CLASS_IMPLEMENTS = 3
10 CLASS_ONLY = 4
11
12
13class EKeys:
14 def __init__(self, ext):
15 self.ext = ext
16 self.dicttypes = {}
17 self.keywords = []
18 self.verbs = []
19 self.blacklist = []
20 self.keyloads = ["init", "shutdown", "custom"]
21 self.implementsbl = ["construtor", "destructor", "finalize"]
22 self.funclist = Function_List_Type.CLASS_IMPLEMENTS
23
24 def type_convert(self, eotype):
25 return eotype.name
26
27 def event_convert(self, event):
28 return event.c_name
29
30 def print_arg(self, eoarg):
31 return "arg_{}".format(eoarg.name)
32
33 def format_name(self, func):
34 return self.name
35
36
37class EMonoKeys(EKeys):
38 def __init__(self, ext):
39 super().__init__(ext)
40 self.dicttypes = {
41 "byte": "sbyte",
42 "llong": "long",
43 "int8": "sbyte",
44 "int16": "short",
45 "int32": "int",
46 "int64": "long",
47 "ssize": "long",
48 "ubyte": "byte",
49 "ullong": "ulong",
50 "uint8": "byte",
51 "uint16": "ushort",
52 "uint32": "uint",
53 "uint64": "ulong",
54 "size": "ulong",
55 "ptrdiff": "long",
56 "intptr": "System.IntPtr",
57 "uintptr": "System.IntPtr",
58 "void_ptr": "System.IntPtr",
59 "void": "System.IntPtr", # only if is out/inout
60 "Error": "eina.Error",
61 "string": "System.String",
62 "mstring": "System.String",
63 "stringshare": "System.String",
64 "any_value": "eina.Value",
65 "any_value_ptr": "eina.Value"
66 # complex Types
67 ,
68 "list": "eina.List",
69 "inlist": "eina.Inlist",
70 "array": "eina.Array",
71 "inarray": "eina.Inarray",
72 "hash": "eina.Hash",
73 "promise": "int",
74 "future": "int",
75 "iterator": "eina.Iterator",
76 "accessor": "int",
77 }
78
79 self.keywords = [
80 "delete",
81 "do",
82 "lock",
83 "event",
84 "in",
85 "object",
86 "interface",
87 "string",
88 "internal",
89 "fixed",
90 "base",
91 ]
92
93 self.verbs = [
94 "add",
95 "get",
96 "is",
97 "del",
98 "thaw",
99 "freeze",
100 "save",
101 "wait",
102 "eject",
103 "raise",
104 "lower",
105 "load",
106 "dup",
107 "reset",
108 "unload",
109 "close",
110 "set",
111 "interpolate",
112 "has",
113 "grab",
114 "check",
115 "find",
116 "ungrab",
117 "unset",
118 "clear",
119 "pop",
120 "new",
121 "peek",
122 "push",
123 "update",
124 "show",
125 "move",
126 "hide",
127 "calculate",
128 "resize",
129 "attach",
130 "pack",
131 "unpack",
132 "emit",
133 "call",
134 "append",
135 ]
136
137 self.blacklist = [
138 "efl_event_callback_array_priority_add",
139 "efl_player_position_get",
140 "efl_text_font_source",
141 "efl_ui_focus_manager_focus_get",
142 "efl_ui_widget_focus",
143 "efl_ui_text_password",
144 "elm_interface_scrollable_repeat_events",
145 "elm_wdg_item_del",
146 "elm_wdg_item_focus",
147 "elm_interface_scrollable_mirrored_set",
148 "evas_obj_table_mirrored",
149 "edje_obj_load_error_get",
150 "efl_ui_focus_user_parent_get",
151 "efl_canvas_object_scale", # duplicated signature
152 "efl_access_parent_get",
153 "efl_access_name",
154 "efl_access_root_get",
155 "efl_access_type_get",
156 "efl_access_role_get",
157 "efl_access_action_description",
158 "efl_access_image_description",
159 "efl_access_component_layer_get", # duplicated signature
160 "efl_access_component_alpha_get",
161 "efl_access_component_size_get",
162 "efl_ui_spin_button_loop_get",
163 "efl_ui_list_model_size_get",
164 "efl_ui_list_relayout_layout_do",
165 ]
166
167 def escape_keyword(self, key):
168 key = "kw_{}".format(key) if key.lower() in self.keywords else key
169 return "{}Add".format(key) if key == "Finalize" else key
170
171 def direction_get(self, direction):
172 if direction == direction.INOUT:
173 return "ref"
174 if direction == direction.OUT:
175 return "out"
176 return None
177
178 def klass_name(self, eotype):
179 *namespaces, name = eotype.name.split(".")
180 namespaces = [self.escape_keyword(x.lower()) for x in namespaces]
181 is_interface = eotype.type == eotype.type.CLASS
182 k_name = ("I" if is_interface else "") + name
183 return ".".join(namespaces + [k_name])
184
185 def type_convert(self, eotype):
186 if eotype.type == eotype.type.VOID:
187 return "System.IntPtr"
188
189 new_type = self.dicttypes.get(eotype.name, self.klass_name(eotype))
190 if new_type != "int" and eotype.base_type:
191 new_type = "{}<{}>".format(
192 new_type,
193 self.dicttypes.get(
194 eotype.base_type.name, self.klass_name(eotype.base_type)
195 ),
196 )
197
198 return new_type
199
200 def event_convert(self, event):
201 return "{}Evt".format("".join([i.capitalize() for i in event.name.split(",")]))
202
203 def print_arg(self, eoarg):
204 r = super().print_arg(eoarg)
205 prefix = self.direction_get(eoarg.direction) or None
206
207 if prefix == "out" and (eoarg.type.name in ("Eina.Slice", "Eina.Rw_Slice")):
208 prefix = "ref"
209
210 if (
211 not prefix
212 and eoarg.type.is_ptr
213 and eoarg.type.type == eoarg.type.type.REGULAR
214 and eoarg.type.typedecl
215 and eoarg.type.typedecl.type == eoarg.type.typedecl.type.STRUCT
216 ):
217 prefix = "ref"
218
219 return " ".join([prefix, r]) if prefix else r
220
221 def format_name(self, func):
222 names = func.comp.name.split("_")
223
224 if func.type == func.type.METHOD and names[-1] in self.verbs:
225 names.insert(0, names.pop())
226
227 fname = "".join([name.capitalize() for name in names])
228
229 if func.type == func.type.METHOD:
230 fname = self.escape_keyword(fname)
231 fname = "Do{}".format(fname) if fname == func.class_.short_name else fname
232
233 return fname
234
235
236def GetKey(ext):
237 if ext == ".cs":
238 return EMonoKeys(ext)
239 return EKeys(ext)
diff --git a/src/scripts/testgen/suitegen.py b/src/scripts/testgen/suitegen.py
new file mode 100644
index 0000000000..426fc28074
--- /dev/null
+++ b/src/scripts/testgen/suitegen.py
@@ -0,0 +1,197 @@
1import itertools
2import os
3from pyolian.eolian import Eolian_Function_Type, Eolian_Class_Type
4from .ekeys import GetKey, Function_List_Type
5
6
7class BaseItem:
8 def __init__(self, path, keys, prefix=""):
9 self.path = path
10 self.keys = keys
11 self.prefix = prefix
12
13 def __getattr__(self, attr):
14 if not attr.split("_")[-1] in self.keys.keyloads:
15 raise AttributeError("Error getting {}".format(attr))
16
17 filename = os.path.join(self.path, self.prefix + attr) + self.keys.ext
18 if os.path.isfile(filename):
19 with open(filename, "r") as f:
20 return f.read()
21 return None
22
23
24class ComItem(BaseItem):
25 def __init__(self, comp, path, keys):
26 super().__init__(path, keys)
27 self.comp = comp
28
29 def __getattr__(self, attr):
30 if hasattr(self.comp, attr):
31 return getattr(self.comp, attr)
32 return super().__getattr__(attr)
33
34
35class FuncItem(ComItem):
36 def __init__(self, comp, path, keys):
37 super().__init__(comp, os.path.join(path, comp.name), keys)
38
39 self.has_getter = (
40 comp.type in (Eolian_Function_Type.PROP_GET, Eolian_Function_Type.PROPERTY)
41 and comp.full_c_getter_name not in keys.blacklist
42 and not os.path.isfile("{}_get".format(os.path.join(path, comp.name)))
43 )
44 self.has_setter = (
45 comp.type in (Eolian_Function_Type.PROP_SET, Eolian_Function_Type.PROPERTY)
46 and comp.full_c_setter_name not in keys.blacklist
47 and not os.path.isfile("{}_set".format(os.path.join(path, comp.name)))
48 )
49
50 self.is_enum = (
51 lambda arg: arg.type
52 and arg.type.typedecl
53 and arg.type.typedecl.type == arg.type.typedecl.type.ENUM
54 )
55 self.is_number = lambda arg: arg.type and arg.type.builtin_type in (
56 arg.type.builtin_type.INT,
57 arg.type.builtin_type.UINT,
58 arg.type.builtin_type.LONG,
59 arg.type.builtin_type.ULONG,
60 arg.type.builtin_type.LLONG,
61 arg.type.builtin_type.ULLONG,
62 arg.type.builtin_type.INT8,
63 arg.type.builtin_type.UINT8,
64 arg.type.builtin_type.INT16,
65 arg.type.builtin_type.UINT16,
66 arg.type.builtin_type.INT32,
67 arg.type.builtin_type.UINT32,
68 arg.type.builtin_type.INT64,
69 arg.type.builtin_type.UINT64,
70 arg.type.builtin_type.INT128,
71 arg.type.builtin_type.UINT128,
72 )
73
74 @property
75 def getter_args(self):
76 return itertools.chain(self.getter_values, self.getter_keys)
77
78 @property
79 def setter_args(self):
80 return itertools.chain(self.setter_values, self.setter_keys)
81
82 @property
83 def format_name(self):
84 return self.keys.format_name(self)
85
86
87class EventItem(ComItem):
88 def __init__(self, comp, path, keys):
89 self.myname = comp.name.replace(",", "_")
90 super().__init__(comp, os.path.join(path, self.myname), keys)
91 self.format_name = self.keys.event_convert(self)
92
93
94class ClassItem(ComItem):
95 def __init__(self, comp, path, keys):
96 self.myname = os.path.splitext(comp.file)[0]
97 super().__init__(comp, os.path.join(path, self.myname), keys)
98
99 mfilter = (
100 lambda f: f.full_c_method_name not in self.keys.blacklist
101 and not os.path.isfile(os.path.join(self.path, f.name))
102 )
103
104 self.methods = [
105 FuncItem(m, self.path, keys) for m in filter(mfilter, self.comp.methods)
106 ]
107 self._properties = [
108 FuncItem(p, self.path, keys) for p in filter(mfilter, self.comp.properties)
109 ]
110 self.events = [EventItem(s, self.path, keys) for s in self.comp.events]
111
112 if self.keys.funclist in (
113 Function_List_Type.INHERITIS,
114 Function_List_Type.INHERITIS_FULL,
115 ):
116 for eoclass in (
117 eoclass.inherits
118 if self.keys.funclist == Function_List_Type.INHERITIS
119 else eoclass.inherits_full
120 ):
121 for f in filter(mfilter, eoclass.methods):
122 self.methods.append(FuncItem(f, self.path, keys))
123 for f in filter(mfilter, eoclass.properties):
124 self._properties.append(FuncItem(f, self.path, keys))
125 elif self.keys.funclist == Function_List_Type.CLASS_IMPLEMENTS:
126 for imp in filter(
127 lambda i: not i.namespace == self.name
128 and not i.short_name.lower() in self.keys.implementsbl,
129 comp.implements,
130 ): # FIXME implements list
131 f = imp.function
132 if f.type == Eolian_Function_Type.METHOD and mfilter(f):
133 self.methods.append(FuncItem(f, self.path, keys))
134 if f.type in (
135 Eolian_Function_Type.PROPERTY,
136 Eolian_Function_Type.PROP_GET,
137 Eolian_Function_Type.PROP_SET,
138 ) and mfilter(f):
139 self._properties.append(FuncItem(f, self.path, keys))
140
141 @property
142 def properties(self):
143 return filter(lambda p: p.has_setter or p.has_getter, self._properties)
144
145 @property
146 def properties_get(self):
147 return filter(lambda p: p.has_getter, self._properties)
148
149 @property
150 def properties_set(self):
151 return filter(lambda p: p.has_setter, self._properties)
152
153 def __iter__(self):
154 return itertools.chain(self.methods, self.properties)
155
156
157class SuiteGen(BaseItem):
158 def __init__(self, name, testname, filename, path, template=None):
159 keys = GetKey(os.path.splitext(filename)[1])
160 super().__init__(path, keys, name + "_")
161 self.name = name
162 self.testname = testname
163 self.fullname = "_".join([name, testname]) if testname else name
164 self.filename = filename
165 self.template = template
166 self.clslist = []
167
168 if not self.template:
169 script_path = os.path.dirname(os.path.realpath(__file__))
170 self.template = os.path.join(
171 script_path, "testgenerator{}.template".format(self.keys.ext)
172 )
173
174 def __iter__(self):
175 return iter(self.clslist)
176
177 def type_convert(self, eotype):
178 return self.keys.type_convert(eotype)
179
180 def print_arg(self, eoarg):
181 return self.keys.print_arg(eoarg)
182
183 def loadFiles(self, eolian_db, eofiles):
184 self.clslist.clear()
185 for eofile in eofiles:
186 eocls = eolian_db.class_by_file_get(os.path.basename(eofile))
187 if not eocls or eocls.type != Eolian_Class_Type.REGULAR:
188 continue
189 self.loadObj(eocls)
190
191 def loadObj(self, eocls):
192 cls = ClassItem(eocls, self.path, self.keys)
193 if not os.path.isfile(cls.path):
194 cls.myfullname = "{}_{}".format(self.fullname, cls.myname)
195 self.clslist.append(cls)
196 else:
197 print("removing {} Class from generated list".format(cls.name))
diff --git a/src/scripts/testgen/testgen.py b/src/scripts/testgen/testgen.py
new file mode 100755
index 0000000000..b91d7b7e81
--- /dev/null
+++ b/src/scripts/testgen/testgen.py
@@ -0,0 +1,116 @@
1#!/usr/bin/env python3
2# encoding: utf-8
3
4import os
5import sys
6import datetime
7
8script_path = os.path.dirname(os.path.realpath(__file__))
9
10if "EFL_DIR" in os.environ:
11 root_path = os.environ["EFL_DIR"]
12else:
13 root_path = os.path.abspath(os.path.join(script_path, "..", "..", ".."))
14
15sys.path.insert(0, os.path.join(root_path, "src", "scripts"))
16
17from pyolian import eolian
18from pyolian import pyratemp
19from testgen.suitegen import SuiteGen
20
21# Use .eo files from the source tree (not the installed ones)
22SCAN_FOLDER = os.path.join(root_path, "src", "lib")
23
24# create main eolian state
25eolian_db = eolian.Eolian_State()
26if not isinstance(eolian_db, eolian.Eolian_State):
27 raise (RuntimeError("Eolian, failed to create Eolian state"))
28
29# eolian source tree scan
30if not eolian_db.directory_add(SCAN_FOLDER):
31 raise (RuntimeError("Eolian, failed to scan source directory"))
32
33# Parse all known eo files
34if not eolian_db.all_eot_files_parse():
35 raise (RuntimeError("Eolian, failed to parse all EOT files"))
36
37if not eolian_db.all_eo_files_parse():
38 raise (RuntimeError("Eolian, failed to parse all EO files"))
39
40# cleanup the database on exit
41import atexit
42
43
44def cleanup_db():
45 global eolian_db
46 del eolian_db
47
48
49atexit.register(cleanup_db)
50
51class Template(pyratemp.Template):
52 def __init__(
53 self,
54 filename,
55 encoding="utf-8",
56 loader_class=pyratemp.LoaderFile,
57 parser_class=pyratemp.Parser,
58 renderer_class=pyratemp.Renderer,
59 eval_class=pyratemp.EvalPseudoSandbox,
60 ):
61
62 global_ctx = {}
63 global_ctx.update(
64 {
65 # Template info
66 "date": datetime.datetime.now(),
67 "template_file": os.path.basename(filename),
68 }
69 )
70
71 self.template_filename = filename
72 pyratemp.Template.__init__(
73 self,
74 filename=filename,
75 encoding=encoding,
76 data=global_ctx,
77 loader_class=loader_class,
78 parser_class=parser_class,
79 renderer_class=renderer_class,
80 eval_class=eval_class,
81 )
82
83 def render(self, suite, verbose=True):
84 # Build the context for the template
85 ctx = {}
86 ctx["suite"] = suite
87 # render with the augmented context
88 output = self(**ctx)
89
90 if suite.filename is not None:
91 # write to file
92 with open(suite.filename, "w") as f:
93 f.write(output)
94
95
96if __name__ == "__main__":
97 import argparse
98
99 parser = argparse.ArgumentParser(description="Eolian Test Generator.")
100 parser.add_argument("testname", help="The Test Name used to find custom and template files. (REQUIRED)")
101 parser.add_argument("suitename", help="The Suite Name used to find custom files. (REQUIRED)")
102 parser.add_argument("filename", help="Generated test file destination. (REQUIRED)")
103 parser.add_argument("eofiles", nargs="*", help="The Eolian Files to use.")
104
105 args = parser.parse_args()
106
107 testdir = os.path.join(root_path, "src", "tests", args.testname)
108
109 suite = SuiteGen(args.suitename, args.testname, args.filename, testdir)
110 suite.loadFiles(eolian_db, args.eofiles)
111
112 t = Template(suite.template)
113 # try:
114 t.render(suite)
115# except:
116# print("ERROR RENDERING - Cannot create file: {}".format(suite.filename))
diff --git a/src/scripts/testgen/testgenerator.c.template b/src/scripts/testgen/testgenerator.c.template
new file mode 100644
index 0000000000..c6a8f8ada1
--- /dev/null
+++ b/src/scripts/testgen/testgenerator.c.template
@@ -0,0 +1,177 @@
1<!--(macro m_show)-->
2 <!--(if mshow)-->
3${mshow}$#!
4 <!--(end)-->
5<!--(end)-->
6<!--(macro init)-->
7 Eo *parent = NULL;
8 Eo *obj = NULL;
9
10 <!--(if exists("mfunc") and mfunc!= None)-->
11${mfunc}$
12 <!--(elif exists("mcls") and mcls!= None)-->
13${mcls}$
14 <!--(else)-->
15 obj = efl_add_ref(${cls.c_name}$, parent);
16 fail_if(!obj, "ERROR: Cannot init ${cls.name}$!\n");
17 <!--(end)-->
18<!--(end)-->
19<!--(macro shutdown)-->
20 /** shutdown **/
21 <!--(if exists("mfunc") and mfunc != None)-->
22${mfunc}$
23 <!--(elif exists("mcls") and mcls != None)-->
24${mcls}$
25 <!--(end)-->
26 efl_unref(obj);
27<!--(end)-->
28<!--(macro arg_default)-->
29 <!--(if arg.type.name == "__builtin_free_cb" or arg.type.is_ptr or arg.type.type == arg.type.type.CLASS or arg.type.builtin_type == arg.type.builtin_type.STRING)-->NULL<!--(elif arg.type.builtin_type == arg.type.builtin_type.ANY_VALUE)-->EINA_VALUE_EMPTY<!--(elif arg.type.typedecl and arg.type.typedecl.type == arg.type.typedecl.type.STRUCT )-->{}<!--(else)-->0<!--(end)-->;
30<!--(end)-->
31<!--(macro args_declaration)-->
32 <!--(for arg in args)-->
33 <!--(if arg.type.typedecl and arg.type.typedecl.type == arg.type.typedecl.type.FUNCTION_POINTER)-->
34 void * arg_${arg.name}$_data = NULL;
35 ${arg.type.c_type_param}$ arg_${arg.name}$ = NULL;
36 Eina_Free_Cb arg_${arg.name}$_free_cb = NULL;
37 <!--(else)-->
38 ${arg.type.c_type_param}$ arg_${arg.name}$ = ${arg_default(arg=arg)}$
39 <!--(end)-->
40 <!--(end)-->
41<!--(end)-->
42<!--(macro print_arg)-->
43 <!--(if arg.type.typedecl and arg.type.typedecl.type == arg.type.typedecl.type.FUNCTION_POINTER)-->
44arg_${arg.name}$_data, arg_${arg.name}$, arg_${arg.name}$_free_cb
45 <!--(else)-->
46 <!--(if arg.direction in (arg.direction.OUT, arg.direction.INOUT))-->&<!--(end)-->arg_${arg.name}$
47 <!--(end)-->
48<!--(end)-->
49
50#ifdef HAVE_CONFIG_H
51# include <config.h>
52#endif
53
54#include <check.h>
55#include "efl_check.h"
56${m_show(mshow=suite.custom)}$#!
57#include <Elementary.h>
58
59<!--(for cls in suite)-->
60void ${cls.myfullname}$_test(TCase *tc);
61<!--(end)-->
62
63static const Efl_Test_Case etc[] = {
64<!--(for cls in suite)-->
65 { "${suite.name.capitalize()}$ ${suite.testname.capitalize()}$ ${cls.myname.capitalize()}$", ${cls.myfullname}$_test },
66<!--(end)-->
67 { NULL, NULL }
68};
69
70<!--(for cls in suite)-->
71
72/**************** TEST CASE ${cls.c_name}$ ****************/
73${m_show(mshow=cls.custom)}$#!
74
75START_TEST(${cls.myfullname}$_smoke)
76{
77${init(mcls=cls.init)}$
78${shutdown(mcls=cls.shutdown)}$
79}
80END_TEST
81
82 <!--(for func in cls.methods)-->
83START_TEST(${cls.myfullname}$_${func.full_c_method_name}$)
84{
85${args_declaration(args=func.parameters)}$${init(mcls=cls.init,mfunc=func.init)}$
86${m_show(mshow=func.arg_init)}$#!
87 <!--(if func.method_return_type)-->${func.method_return_type.c_type_return}$ r = <!--(end)-->${func.full_c_method_name}$(obj<!--(for arg in func.parameters)-->,${print_arg(arg=arg)}$<!--(end)-->);
88 <!--(if func.method_return_type)-->(void)r;<!--(end)-->
89${m_show(mshow=func.arg_shutdown)}$#!
90${shutdown(mcls=cls.shutdown,mfunc=func.shutdown)}$
91}
92END_TEST
93
94 <!--(end)-->
95
96 <!--(for func in cls.properties)-->
97 <!--(if func.has_getter)-->
98START_TEST(${cls.myfullname}$_${func.full_c_getter_name}$)
99{
100 <!--(if len(list(func.getter_values)) > 1)-->
101${args_declaration(args=func.getter_values)}$
102 <!--(end)-->
103${args_declaration(args=func.getter_keys)}$${init(mcls=cls.init,mfunc=func.get_init)}$
104${m_show(mshow=func.arg_get_init)}$#!
105 <!--(if len(list(func.getter_values)) == 1)-->
106 ${list(func.getter_values)[0].type.c_type_return}$ r = ${func.full_c_getter_name}$(obj<!--(for arg in func.getter_keys)-->, arg_${arg.name}$<!--(end)-->);
107 (void)r;
108 <!--(else)-->
109 ${func.full_c_getter_name}$(obj<!--(for arg in func.getter_keys)-->, arg_${arg.name}$<!--(end)--><!--(for arg in func.getter_values)-->, &arg_${arg.name}$<!--(end)-->);
110 <!--(end)-->
111${m_show(mshow=func.arg_get_shutdown)}$#!
112${shutdown(mcls=cls.shutdown,mfunc=func.get_shutdown)}$
113}
114END_TEST
115
116 <!--(end)-->
117 <!--(if func.has_setter)-->
118START_TEST(${cls.myfullname}$_${func.full_c_setter_name}$)
119{
120${args_declaration(args=func.setter_keys)}$${args_declaration(args=func.setter_values)}$${init(mcls=cls.init,mfunc=func.set_init)}$
121${m_show(mshow=func.arg_set_init)}$#!
122 ${func.full_c_setter_name}$(obj<!--(for arg in func.setter_keys)-->, arg_${arg.name}$<!--(end)--><!--(for arg in func.setter_values)-->, arg_${arg.name}$<!--(end)-->);
123${m_show(mshow=func.arg_set_shutdown)}$#!
124${shutdown(mcls=cls.shutdown,mfunc=func.set_shutdown)}$
125}
126END_TEST
127
128 <!--(end)-->
129 <!--(end)-->
130void ${cls.myfullname}$_test(TCase *tc)
131{
132 tcase_add_test(tc, ${cls.myfullname}$_smoke);
133 <!--(for func in cls.methods)-->
134 tcase_add_test(tc, ${cls.myfullname}$_${func.full_c_method_name}$);
135 <!--(end)-->
136 <!--(for func in cls.properties_get)-->
137 tcase_add_test(tc, ${cls.myfullname}$_${func.full_c_getter_name}$);
138 <!--(end)-->
139 <!--(for func in cls.properties_set)-->
140 tcase_add_test(tc, ${cls.myfullname}$_${func.full_c_setter_name}$);
141 <!--(end)-->
142}
143<!--(end)-->
144
145SUITE_INIT(${suite.name}$)
146{
147 fail_if(!eina_init(), "ERROR: Cannot init Eina!\n");
148 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
149 fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
150${m_show(mshow=suite.init)}$#!
151}
152
153SUITE_SHUTDOWN(${suite.name}$)
154{
155${m_show(mshow=suite.shutdown)}$#!
156 ecore_shutdown();
157 eina_shutdown();
158}
159
160int
161main(int argc, char **argv)
162{
163 int failed_count;
164
165 if (!_efl_test_option_disp(argc, argv, etc))
166 return 0;
167
168#ifdef NEED_RUN_IN_TREE
169 putenv("EFL_RUN_IN_TREE=1");
170#endif
171
172 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
173 "${suite.fullname}$", etc, SUITE_INIT_FN(${suite.name}$), SUITE_SHUTDOWN_FN(${suite.name}$));
174
175 return (failed_count == 0) ? 0 : 255;
176}
177
diff --git a/src/scripts/testgen/testgenerator.cs.template b/src/scripts/testgen/testgenerator.cs.template
new file mode 100644
index 0000000000..aca9903d5e
--- /dev/null
+++ b/src/scripts/testgen/testgenerator.cs.template
@@ -0,0 +1,113 @@
1<!--(macro m_show)-->
2 <!--(if mshow)-->
3${mshow}$#!
4 <!--(end)-->
5<!--(end)-->
6<!--(macro def_obj)-->${'.'.join(param.type.namespaces).lower()}$.I${param.type.short_name}$ arg_${param.name}$ = null;<!--(end)-->
7<!--(macro def_param)-->
8 <!--(if param.type.type == param.type.type.CLASS)-->${def_obj(param=param)}$<!--(else)-->${suite.type_convert(param.type)}$ arg_${param.name}$ = default(${suite.type_convert(param.type)}$);<!--(end)-->
9<!--(end)-->
10<!--(macro def_params)-->
11 <!--(for p in parameters)-->
12 ${def_param(param=p)}$
13 <!--(end)-->
14<!--(end)-->
15<!--(macro meth_target)-->
16 <!--(if func.is_class)-->${'.'.join(cls.namespaces).lower()}$.${cls.short_name}$<!--(else)-->obj<!--(end)-->
17<!--(end)-->
18using System;
19
20namespace TestSuite
21{
22<!--(if suite.custom)-->${suite.custom}$<!--(end)-->
23<!--(for cls in suite)-->
24/**************** TEST CASE ${cls.c_name}$ ****************/
25class Test${cls.name.replace('.','')}$
26{
27
28 ${'.'.join(cls.namespaces).lower()}$.I${cls.short_name}$ obj;
29${m_show(mshow=cls.custom)}$#!
30
31 public void SetUp()
32 {
33${m_show(mshow=suite.init)}$#!
34 <!--(if cls.init)-->
35${cls.init}$
36 <!--(else)-->
37 obj = new ${'.'.join(cls.namespaces).lower()}$.${cls.short_name}$();
38 <!--(end)-->
39 }
40
41 public void TearDown()
42 {
43${m_show(mshow=suite.shutdown)}$#!
44 <!--(if cls.shutdown)-->
45${cls.shutdown}$
46 <!--(else)-->
47 obj.Dispose();
48 obj = null;
49 <!--(end)-->
50 }
51
52 public void smoke()
53 {
54 }
55
56#! METHODS
57 <!--(for func in cls.methods)-->
58 public void ${func.name}$()
59 {
60 <!--(if len(list(func.parameters)) > 0)-->
61${def_params(parameters=func.parameters)}$
62 <!--(end)-->
63${m_show(mshow=func.arg_init)}$#!
64${m_show(mshow=func.init)}$#!
65 <!--(if func.method_return_type)-->var r = <!--(end)-->${meth_target(func=func, cls=cls)}$.${func.format_name}$(${', '.join([ suite.print_arg(p) for p in func.parameters])}$);
66${m_show(mshow=func.arg_shutdown)}$#!
67${m_show(mshow=func.shutdown)}$#!
68 }
69
70 <!--(end)-->
71#! PROPERTIES FUNCTION GET
72 <!--(for func in cls.properties)-->
73 <!--(if func.has_getter)-->
74 public void ${func.name}$_pget()
75 {
76 <!--(if func.getter_return_type or len(list(func.getter_values)) > 1)-->
77${def_params(parameters=func.getter_values)}$
78 <!--(end)-->
79 <!--(if len(list(func.getter_keys)) > 0)-->
80${def_params(parameters=func.getter_keys)}$
81 <!--(end)-->
82${m_show(mshow=func.arg_get_init)}$#!
83${m_show(mshow=func.get_init)}$#!
84 <!--(if not func.getter_return_type and len(list(func.getter_values)) == 1)-->
85 var arg_${list(func.getter_values)[0].name}$ = ${meth_target(func=func, cls=cls)}$.Get${func.format_name}$(${', '.join(['arg_{}'.format(param.name) for param in func.getter_keys])}$);
86 <!--(else)-->
87 <!--(if func.getter_return_type)-->var r = <!--(end)-->${meth_target(func=func, cls=cls)}$.Get${func.format_name}$(${', '.join([suite.print_arg(p) for p in func.getter_keys] + ['out arg_{}'.format(p.name) for p in func.getter_values])}$);
88 <!--(end)-->
89${m_show(mshow=func.arg_get_shutdown)}$#!
90${m_show(mshow=func.get_shutdown)}$#!
91 }
92
93 <!--(end)-->
94#! PROPERTIES FUNCTION SET
95 <!--(if func.has_setter)-->
96 public void ${func.name}$_pset()
97 {
98${def_params(parameters=func.setter_values)}$
99 <!--(if len(list(func.setter_keys)) > 0)-->
100${def_params(parameters=func.setter_keys)}$
101 <!--(end)-->
102${m_show(mshow=func.arg_set_init)}$#!
103${m_show(mshow=func.set_init)}$#!
104 ${meth_target(func=func, cls=cls)}$.Set${func.format_name}$(${', '.join([suite.print_arg(p) for p in list(func.setter_keys) + list(func.setter_values)])}$);
105${m_show(mshow=func.arg_set_shutdown)}$#!
106${m_show(mshow=func.set_shutdown)}$#!
107 }
108
109 <!--(end)-->
110 <!--(end)-->
111}
112<!--(end)-->
113}
diff --git a/src/tests/automated/ecore_audio_custom.c b/src/tests/automated/ecore_audio_custom.c
new file mode 100644
index 0000000000..538ed42109
--- /dev/null
+++ b/src/tests/automated/ecore_audio_custom.c
@@ -0,0 +1,3 @@
1#include <Ecore.h>
2#include <Ecore_Audio.h>
3#include <Ecore_File.h>
diff --git a/src/tests/automated/ecore_audio_init.c b/src/tests/automated/ecore_audio_init.c
new file mode 100644
index 0000000000..3dd8aecd65
--- /dev/null
+++ b/src/tests/automated/ecore_audio_init.c
@@ -0,0 +1,2 @@
1 int _rinit = ecore_audio_init();
2 ck_assert_int_eq(_rinit, 1);
diff --git a/src/tests/automated/ecore_audio_out/input_attach/arg_init.c b/src/tests/automated/ecore_audio_out/input_attach/arg_init.c
new file mode 100644
index 0000000000..fcebbe029b
--- /dev/null
+++ b/src/tests/automated/ecore_audio_out/input_attach/arg_init.c
@@ -0,0 +1 @@
arg_input = efl_add(ECORE_AUDIO_IN_CLASS, NULL);
diff --git a/src/tests/automated/ecore_audio_out/input_detach/arg_init.c b/src/tests/automated/ecore_audio_out/input_detach/arg_init.c
new file mode 100644
index 0000000000..fcebbe029b
--- /dev/null
+++ b/src/tests/automated/ecore_audio_out/input_detach/arg_init.c
@@ -0,0 +1 @@
arg_input = efl_add(ECORE_AUDIO_IN_CLASS, NULL);
diff --git a/src/tests/automated/ecore_audio_out_wasapi/init.c b/src/tests/automated/ecore_audio_out_wasapi/init.c
new file mode 100644
index 0000000000..da9426da1e
--- /dev/null
+++ b/src/tests/automated/ecore_audio_out_wasapi/init.c
@@ -0,0 +1,3 @@
1#ifdef _WIN32
2 obj = efl_add_ref(ECORE_AUDIO_OUT_WASAPI_CLASS, parent);
3 fail_if(!obj, "ERROR: Cannot init Ecore.Audio.Out.Wasapi!\n")
diff --git a/src/tests/automated/ecore_audio_out_wasapi/shutdown.c b/src/tests/automated/ecore_audio_out_wasapi/shutdown.c
new file mode 100644
index 0000000000..23fe0f1229
--- /dev/null
+++ b/src/tests/automated/ecore_audio_out_wasapi/shutdown.c
@@ -0,0 +1,3 @@
1#else
2(void)parent;
3#endif
diff --git a/src/tests/automated/ector_custom.c b/src/tests/automated/ector_custom.c
new file mode 100644
index 0000000000..0ff115b738
--- /dev/null
+++ b/src/tests/automated/ector_custom.c
@@ -0,0 +1,3 @@
1#include <cairo/Ector_Cairo.h>
2#include <software/Ector_Software.h>
3#include <gl/Ector_GL.h>
diff --git a/src/tests/automated/ector_init.c b/src/tests/automated/ector_init.c
new file mode 100644
index 0000000000..b0006b6a1f
--- /dev/null
+++ b/src/tests/automated/ector_init.c
@@ -0,0 +1 @@
fail_if(!ector_init(), "ERROR: Cannot init Ector!\n");
diff --git a/src/tests/automated/ector_renderer_cairo_shape/init.c b/src/tests/automated/ector_renderer_cairo_shape/init.c
new file mode 100644
index 0000000000..e0d899fa57
--- /dev/null
+++ b/src/tests/automated/ector_renderer_cairo_shape/init.c
@@ -0,0 +1,2 @@
1Ector_Surface *surface = efl_add(ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS, NULL);
2obj = efl_add_ref(ECTOR_RENDERER_CAIRO_SHAPE_CLASS, parent, ector_renderer_surface_set(efl_added, surface));
diff --git a/src/tests/automated/ector_shutdown.c b/src/tests/automated/ector_shutdown.c
new file mode 100644
index 0000000000..2428e6ec56
--- /dev/null
+++ b/src/tests/automated/ector_shutdown.c
@@ -0,0 +1 @@
ector_shutdown();
diff --git a/src/tests/automated/edje_custom.c b/src/tests/automated/edje_custom.c
new file mode 100644
index 0000000000..edbf1b78f2
--- /dev/null
+++ b/src/tests/automated/edje_custom.c
@@ -0,0 +1 @@
#define EFL_CANVAS_LAYOUT_BETA
diff --git a/src/tests/automated/edje_init.c b/src/tests/automated/edje_init.c
new file mode 100644
index 0000000000..4e81da1772
--- /dev/null
+++ b/src/tests/automated/edje_init.c
@@ -0,0 +1,2 @@
1 fail_if(!ecore_evas_init(), "ERROR: Cannot init Ecore Evas!\n");
2 fail_if(!edje_init(), "ERROR: Cannot init Edje!\n");
diff --git a/src/tests/automated/edje_shutdown.c b/src/tests/automated/edje_shutdown.c
new file mode 100644
index 0000000000..450dda7d2b
--- /dev/null
+++ b/src/tests/automated/edje_shutdown.c
@@ -0,0 +1,2 @@
1 edje_shutdown();
2 ecore_evas_shutdown();
diff --git a/src/tests/automated/efl_canvas_layout_part/init.c b/src/tests/automated/efl_canvas_layout_part/init.c
new file mode 100644
index 0000000000..7d4a56a17b
--- /dev/null
+++ b/src/tests/automated/efl_canvas_layout_part/init.c
@@ -0,0 +1,9 @@
1 parent = evas_new();
2 evas_output_method_set(parent, evas_render_method_lookup("buffer"));
3 Evas_Engine_Info *einfo = evas_engine_info_get(parent);
4 evas_engine_info_set(parent, einfo);
5
6 evas_output_size_set(parent, 500, 500);
7 evas_output_viewport_set(parent, 0, 0, 500, 500);
8
9 (void)obj;
diff --git a/src/tests/automated/efl_canvas_layout_part_box/init.c b/src/tests/automated/efl_canvas_layout_part_box/init.c
new file mode 100644
index 0000000000..7d4a56a17b
--- /dev/null
+++ b/src/tests/automated/efl_canvas_layout_part_box/init.c
@@ -0,0 +1,9 @@
1 parent = evas_new();
2 evas_output_method_set(parent, evas_render_method_lookup("buffer"));
3 Evas_Engine_Info *einfo = evas_engine_info_get(parent);
4 evas_engine_info_set(parent, einfo);
5
6 evas_output_size_set(parent, 500, 500);
7 evas_output_viewport_set(parent, 0, 0, 500, 500);
8
9 (void)obj;
diff --git a/src/tests/automated/efl_canvas_layout_part_external/init.c b/src/tests/automated/efl_canvas_layout_part_external/init.c
new file mode 100644
index 0000000000..b42f732b75
--- /dev/null
+++ b/src/tests/automated/efl_canvas_layout_part_external/init.c
@@ -0,0 +1,8 @@
1 parent = evas_new();
2 evas_output_method_set(parent, evas_render_method_lookup("buffer"));
3 Evas_Engine_Info *einfo = evas_engine_info_get(parent);
4 evas_engine_info_set(parent, einfo);
5
6 evas_output_size_set(parent, 500, 500);
7 evas_output_viewport_set(parent, 0, 0, 500, 500);
8 (void)obj;
diff --git a/src/tests/automated/efl_canvas_layout_part_swallow/init.c b/src/tests/automated/efl_canvas_layout_part_swallow/init.c
new file mode 100644
index 0000000000..b42f732b75
--- /dev/null
+++ b/src/tests/automated/efl_canvas_layout_part_swallow/init.c
@@ -0,0 +1,8 @@
1 parent = evas_new();
2 evas_output_method_set(parent, evas_render_method_lookup("buffer"));
3 Evas_Engine_Info *einfo = evas_engine_info_get(parent);
4 evas_engine_info_set(parent, einfo);
5
6 evas_output_size_set(parent, 500, 500);
7 evas_output_viewport_set(parent, 0, 0, 500, 500);
8 (void)obj;
diff --git a/src/tests/automated/efl_canvas_layout_part_table/init.c b/src/tests/automated/efl_canvas_layout_part_table/init.c
new file mode 100644
index 0000000000..b42f732b75
--- /dev/null
+++ b/src/tests/automated/efl_canvas_layout_part_table/init.c
@@ -0,0 +1,8 @@
1 parent = evas_new();
2 evas_output_method_set(parent, evas_render_method_lookup("buffer"));
3 Evas_Engine_Info *einfo = evas_engine_info_get(parent);
4 evas_engine_info_set(parent, einfo);
5
6 evas_output_size_set(parent, 500, 500);
7 evas_output_viewport_set(parent, 0, 0, 500, 500);
8 (void)obj;
diff --git a/src/tests/automated/efl_canvas_layout_part_text/init.c b/src/tests/automated/efl_canvas_layout_part_text/init.c
new file mode 100644
index 0000000000..b42f732b75
--- /dev/null
+++ b/src/tests/automated/efl_canvas_layout_part_text/init.c
@@ -0,0 +1,8 @@
1 parent = evas_new();
2 evas_output_method_set(parent, evas_render_method_lookup("buffer"));
3 Evas_Engine_Info *einfo = evas_engine_info_get(parent);
4 evas_engine_info_set(parent, einfo);
5
6 evas_output_size_set(parent, 500, 500);
7 evas_output_viewport_set(parent, 0, 0, 500, 500);
8 (void)obj;
diff --git a/src/tests/automated/efl_canvas_video/init.c b/src/tests/automated/efl_canvas_video/init.c
new file mode 100644
index 0000000000..f75bda251f
--- /dev/null
+++ b/src/tests/automated/efl_canvas_video/init.c
@@ -0,0 +1,2 @@
1 obj = efl_add(EFL_CANVAS_VIDEO_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
2 fail_if(!obj, "Error: Canot get obj!\n");
diff --git a/src/tests/automated/efl_loop/begin/init.c b/src/tests/automated/efl_loop/begin/init.c
new file mode 100644
index 0000000000..78fbba3fca
--- /dev/null
+++ b/src/tests/automated/efl_loop/begin/init.c
@@ -0,0 +1,9 @@
1int argc = 2;
2char *argv[] = { "efl_ui_suite", "test" };
3(void)parent;
4
5_EFL_APP_VERSION_SET();
6obj = efl_app_get();
7efl_event_callback_add(obj, EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL);
8fail_if(!ecore_init_ex(argc, argv));
9__EFL_MAIN_CONSTRUCTOR;
diff --git a/src/tests/automated/efl_loop/begin/shutdown.c b/src/tests/automated/efl_loop/begin/shutdown.c
new file mode 100644
index 0000000000..1f578789d4
--- /dev/null
+++ b/src/tests/automated/efl_loop/begin/shutdown.c
@@ -0,0 +1,3 @@
1efl_loop_exit_code_process(r);
2__EFL_MAIN_DESTRUCTOR;
3ecore_shutdown_ex();
diff --git a/src/tests/automated/efl_loop/custom.c b/src/tests/automated/efl_loop/custom.c
new file mode 100644
index 0000000000..f7df130584
--- /dev/null
+++ b/src/tests/automated/efl_loop/custom.c
@@ -0,0 +1,5 @@
1EAPI_MAIN void
2efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
3{
4 efl_loop_quit(ev->object, EINA_VALUE_EMPTY);
5}
diff --git a/src/tests/automated/efl_loop/timeout/arg_init.c b/src/tests/automated/efl_loop/timeout/arg_init.c
new file mode 100644
index 0000000000..e2e28fb725
--- /dev/null
+++ b/src/tests/automated/efl_loop/timeout/arg_init.c
@@ -0,0 +1 @@
arg_time = 0.5;
diff --git a/src/tests/automated/efl_text_markup_util/init.c b/src/tests/automated/efl_text_markup_util/init.c
new file mode 100644
index 0000000000..4d5230d0b1
--- /dev/null
+++ b/src/tests/automated/efl_text_markup_util/init.c
@@ -0,0 +1 @@
(void)parent;
diff --git a/src/tests/automated/eio_custom.c b/src/tests/automated/eio_custom.c
new file mode 100644
index 0000000000..7f57ce11c4
--- /dev/null
+++ b/src/tests/automated/eio_custom.c
@@ -0,0 +1 @@
#include <Eio.h>
diff --git a/src/tests/automated/eio_init.c b/src/tests/automated/eio_init.c
new file mode 100644
index 0000000000..2787098b73
--- /dev/null
+++ b/src/tests/automated/eio_init.c
@@ -0,0 +1 @@
fail_if(!eio_init(), "ERROR: Cannot init Eio!\n");
diff --git a/src/tests/automated/eio_shutdown.c b/src/tests/automated/eio_shutdown.c
new file mode 100644
index 0000000000..fad342e9ce
--- /dev/null
+++ b/src/tests/automated/eio_shutdown.c
@@ -0,0 +1 @@
eio_shutdown();
diff --git a/src/tests/automated/eldbus_init.c b/src/tests/automated/eldbus_init.c
new file mode 100644
index 0000000000..dcfbbec39e
--- /dev/null
+++ b/src/tests/automated/eldbus_init.c
@@ -0,0 +1 @@
fail_if(eldbus_init() < 0, "ERROR: Cannot init Eldbus!\n");
diff --git a/src/tests/automated/eldbus_shutdown.c b/src/tests/automated/eldbus_shutdown.c
new file mode 100644
index 0000000000..f3077072c5
--- /dev/null
+++ b/src/tests/automated/eldbus_shutdown.c
@@ -0,0 +1 @@
eldbus_shutdown();
diff --git a/src/tests/automated/emotion_custom.c b/src/tests/automated/emotion_custom.c
new file mode 100644
index 0000000000..811c9944a8
--- /dev/null
+++ b/src/tests/automated/emotion_custom.c
@@ -0,0 +1,2 @@
1#include "Emotion.h"
2#include "Evas_Internal.h"
diff --git a/src/tests/automated/emotion_init.c b/src/tests/automated/emotion_init.c
new file mode 100644
index 0000000000..f6d1d030a8
--- /dev/null
+++ b/src/tests/automated/emotion_init.c
@@ -0,0 +1,3 @@
1 fail_if(!ecore_evas_init(), "ERROR: Cannot init ECore Evas!\n");
2 fail_if(!emotion_init(), "ERROR: Cannot init Emotion!\n");
3
diff --git a/src/tests/automated/emotion_shutdown.c b/src/tests/automated/emotion_shutdown.c
new file mode 100644
index 0000000000..e82aef7387
--- /dev/null
+++ b/src/tests/automated/emotion_shutdown.c
@@ -0,0 +1,4 @@
1// efl_unref(parent);
2// ecore_evas_free(ee);
3 emotion_shutdown();
4// ecore_evas_shutdown();
diff --git a/src/tests/automated/evas_custom.c b/src/tests/automated/evas_custom.c
new file mode 100644
index 0000000000..6cd14a5113
--- /dev/null
+++ b/src/tests/automated/evas_custom.c
@@ -0,0 +1 @@
#include "efl_canvas_surface.h"