summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-06-19 20:29:26 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-08-16 17:04:59 -0300
commit63c93a13c001e9e91577c68a813b14057006b815 (patch)
tree213a598fbba7fb3300d125097c6ad27cf17e449f
parent76d774e826c8d8ed2c1b10fdccd91449b287171f (diff)
changes to C test generator
-rw-r--r--src/scripts/testgen/ekeys.py2
-rw-r--r--src/scripts/testgen/testgenerator.c.template16
2 files changed, 14 insertions, 4 deletions
diff --git a/src/scripts/testgen/ekeys.py b/src/scripts/testgen/ekeys.py
index 211dfb1651..035f272000 100644
--- a/src/scripts/testgen/ekeys.py
+++ b/src/scripts/testgen/ekeys.py
@@ -25,7 +25,7 @@ class EKeys:
25 return eotype.name 25 return eotype.name
26 26
27 def event_convert(self, event): 27 def event_convert(self, event):
28 return event.c_name 28 return event.c_macro
29 29
30 def print_arg(self, eoarg): 30 def print_arg(self, eoarg):
31 return "arg_{}".format(eoarg.name) 31 return "arg_{}".format(eoarg.name)
diff --git a/src/scripts/testgen/testgenerator.c.template b/src/scripts/testgen/testgenerator.c.template
index c6a8f8ada1..99fc76d596 100644
--- a/src/scripts/testgen/testgenerator.c.template
+++ b/src/scripts/testgen/testgenerator.c.template
@@ -12,7 +12,7 @@ ${mfunc}$
12 <!--(elif exists("mcls") and mcls!= None)--> 12 <!--(elif exists("mcls") and mcls!= None)-->
13${mcls}$ 13${mcls}$
14 <!--(else)--> 14 <!--(else)-->
15 obj = efl_add_ref(${cls.c_name}$, parent); 15 obj = efl_add_ref(${cls.c_macro}$, parent);
16 fail_if(!obj, "ERROR: Cannot init ${cls.name}$!\n"); 16 fail_if(!obj, "ERROR: Cannot init ${cls.name}$!\n");
17 <!--(end)--> 17 <!--(end)-->
18<!--(end)--> 18<!--(end)-->
@@ -46,6 +46,16 @@ arg_${arg.name}$_data, arg_${arg.name}$, arg_${arg.name}$_free_cb
46 <!--(if arg.direction in (arg.direction.OUT, arg.direction.INOUT))-->&<!--(end)-->arg_${arg.name}$ 46 <!--(if arg.direction in (arg.direction.OUT, arg.direction.INOUT))-->&<!--(end)-->arg_${arg.name}$
47 <!--(end)--> 47 <!--(end)-->
48<!--(end)--> 48<!--(end)-->
49<!--(macro arg_self)-->
50 <!--(if not func.is_class)-->
51 obj
52 <!--(end)-->
53<!--(end)-->
54<!--(macro print_comma)-->
55 <!--(if i > 0 or not is_class)-->
56 ,
57 <!--(end)-->
58<!--(end)-->
49 59
50#ifdef HAVE_CONFIG_H 60#ifdef HAVE_CONFIG_H
51# include <config.h> 61# include <config.h>
@@ -69,7 +79,7 @@ static const Efl_Test_Case etc[] = {
69 79
70<!--(for cls in suite)--> 80<!--(for cls in suite)-->
71 81
72/**************** TEST CASE ${cls.c_name}$ ****************/ 82/**************** TEST CASE ${cls.c_macro}$ ****************/
73${m_show(mshow=cls.custom)}$#! 83${m_show(mshow=cls.custom)}$#!
74 84
75START_TEST(${cls.myfullname}$_smoke) 85START_TEST(${cls.myfullname}$_smoke)
@@ -84,7 +94,7 @@ START_TEST(${cls.myfullname}$_${func.full_c_method_name}$)
84{ 94{
85${args_declaration(args=func.parameters)}$${init(mcls=cls.init,mfunc=func.init)}$ 95${args_declaration(args=func.parameters)}$${init(mcls=cls.init,mfunc=func.init)}$
86${m_show(mshow=func.arg_init)}$#! 96${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)-->); 97 <!--(if func.method_return_type)-->${func.method_return_type.c_type_return}$ r = <!--(end)-->${func.full_c_method_name}$(${arg_self(func=func)}$<!--(for i, arg in enumerate(func.parameters))-->${print_comma(i=i, is_class=func.is_class)}$${print_arg(arg=arg)}$<!--(end)-->);
88 <!--(if func.method_return_type)-->(void)r;<!--(end)--> 98 <!--(if func.method_return_type)-->(void)r;<!--(end)-->
89${m_show(mshow=func.arg_shutdown)}$#! 99${m_show(mshow=func.arg_shutdown)}$#!
90${shutdown(mcls=cls.shutdown,mfunc=func.shutdown)}$ 100${shutdown(mcls=cls.shutdown,mfunc=func.shutdown)}$