#include "efl_ui_spec_suite.h"
#include "suite_helpers.h"
+/* spec-meta-start
+ {"test-interface":"Efl.Content",
+ "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item",
+ "Efl.Ui.List_Default_Item", "Efl.Ui.List_Empty_Item",
+ "Efl.Ui.Navigation_Layout", "Efl.Ui.Panel", "Efl.Ui.Progressbar",
+ "Efl.Ui.Radio", "Efl.Ui.Popup", "Efl.Ui.Tab_Page", "Efl.Ui.Scroller"]}
+
+ spec-meta-end */
+
EFL_START_TEST(content_set_get)
{
Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
#!/usr/bin/python
-tests = [
- ["Efl.Pack_Linear" , "Efl.Ui.Box"],
- ["Efl.Pack" , "Efl.Ui.Table"],
- ["Efl.Content" , "Efl.Ui.Button", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item",
- "Efl.Ui.List_Default_Item", "Efl.Ui.List_Empty_Item",
- "Efl.Ui.Navigation_Layout", "Efl.Ui.Panel", "Efl.Ui.Progressbar",
- "Efl.Ui.Radio", "Efl.Ui.Popup", "Efl.Ui.Tab_Page", "Efl.Ui.Scroller"]
-]
-
fixture_gen_template = """
static void
_{}_fixture(void)
"""
import sys
+import json
+output_file = sys.argv[-1]
+input_files = sys.argv[1:-1]
list_of_tcases = "static const Efl_Test_Case etc[] = {\n"
list_entry = " {{ \"{}-{}\", {}}},\n"
generated_api = ""
def to_class_getter(class_name):
return class_name.replace('.','_').upper()+'_CLASS'
+tests = []
+
+for input_file in input_files:
+ with open(input_file, 'r') as content_file:
+ content = content_file.read()
+ start = content.index('spec-meta-start') + len('spec-meta-start')
+ end = content.index('spec-meta-end')
+ resulting_json = content[start:end]
+ tmp = json.loads(resulting_json)
+ if "test-interface" in tmp and "test-widgets" in tmp:
+ tests.append(tmp)
+
widgets = []
for test in tests:
- interface_test = to_func_name(test[0])
- for widget_class in test[1:]:
+ interface_test = to_func_name(test["test-interface"])
+ for widget_class in test["test-widgets"]:
combo_name = "_{}_{}".format(to_func_name(interface_test), to_func_name(widget_class));
list_of_tcases += list_entry.format(interface_test, to_func_name(widget_class), combo_name)
generated_api += tcase_gen_template.format(combo_name, to_func_name(widget_class), interface_to_api(interface_test))
list_of_tcases += " { NULL, NULL }\n};"
-output = open(sys.argv[1], "w")
+output = open(output_file, "w")
output.write(file_gen_template.format(list_of_tcases, generated_api))
-efl_ui_suite_behavior_src = [
+
+efl_ui_suite_behavior_test_files = files([
+ 'efl_test_pack.c',
+ 'efl_test_pack_linear.c',
+ 'efl_test_content.c',
+])
+
+efl_ui_suite_behavior_src = files([
join_paths('..','suite_helpers.c'),
join_paths('..','suite_helpers.h'),
join_paths('..','elm_test_init.c'),
'efl_ui_spec_suite.c',
- 'efl_test_pack.c',
- 'efl_test_pack_linear.c',
'efl_test_container.c',
- 'efl_test_content.c',
-]
+]) + efl_ui_suite_behavior_test_files
test_generator = find_program('generator.py')
generated_test_parts = custom_target('generate_test_suite',
+ input: efl_ui_suite_behavior_test_files,
output: 'efl_ui_spec_suite_gen.x',
- command: [test_generator, '@OUTPUT@'],
+ command: [test_generator, '@INPUT@', '@OUTPUT@'],
)
efl_ui_behavior_suite = executable('efl_ui_spec_suite',