2018-02-26 11:48:24 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
#include <check.h>
|
|
|
|
#define EFL_NOLEGACY_API_SUPPORT
|
|
|
|
#include <Efl_Ui.h>
|
|
|
|
#include "../efl_check.h"
|
|
|
|
|
|
|
|
EAPI_MAIN void
|
|
|
|
efl_main(void *data EINA_UNUSED,
|
|
|
|
const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
Efl_Loop_Arguments *arge = ev->info;
|
|
|
|
|
|
|
|
fail_if(!arge->initialization);
|
|
|
|
fprintf(stderr, "ARGC %d\n", eina_array_count(arge->argv));
|
2018-03-06 06:43:06 -08:00
|
|
|
fail_if(eina_array_count(arge->argv) != 2);
|
|
|
|
fail_if(!eina_streq(eina_array_data_get(arge->argv, 1), "test"));
|
2018-02-26 11:48:24 -08:00
|
|
|
|
|
|
|
efl_loop_quit(ev->object, eina_value_string_init("success"));
|
|
|
|
}
|
|
|
|
|
2018-03-26 11:19:28 -07:00
|
|
|
EFL_START_TEST(efl_ui_test_init)
|
2018-02-26 11:48:24 -08:00
|
|
|
{
|
|
|
|
/* EFL_MAIN */
|
|
|
|
Eina_Value *ret__;
|
|
|
|
int real__;
|
|
|
|
|
|
|
|
int argc = 2;
|
|
|
|
char *argv[] = { "efl_ui_suite", "test" };
|
|
|
|
_efl_startup_time = ecore_time_unix_get();
|
|
|
|
_EFL_APP_VERSION_SET();
|
|
|
|
fail_if(!ecore_init());
|
2018-12-19 11:02:08 -08:00
|
|
|
efl_event_callback_add(efl_app_main_get(EFL_APP_CLASS), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL);
|
2018-02-26 11:48:24 -08:00
|
|
|
fail_if(!ecore_init_ex(argc, argv));
|
|
|
|
__EFL_MAIN_CONSTRUCTOR;
|
2018-12-19 11:02:08 -08:00
|
|
|
ret__ = efl_loop_begin(efl_app_main_get(EFL_APP_CLASS));
|
2018-02-26 11:48:24 -08:00
|
|
|
real__ = efl_loop_exit_code_process(ret__);
|
2019-01-29 06:26:51 -08:00
|
|
|
fail_if(real__ != 0);
|
2018-02-26 11:48:24 -08:00
|
|
|
__EFL_MAIN_DESTRUCTOR;
|
|
|
|
ecore_shutdown_ex();
|
|
|
|
ecore_shutdown();
|
|
|
|
}
|
2018-03-26 11:19:28 -07:00
|
|
|
EFL_END_TEST
|
2018-02-26 11:48:24 -08:00
|
|
|
|
|
|
|
void efl_ui_test(TCase *tc)
|
|
|
|
{
|
|
|
|
tcase_add_test(tc, efl_ui_test_init);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Efl_Test_Case etc[] = {
|
|
|
|
{ "Efl_Ui", efl_ui_test },
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2018-03-27 10:51:13 -07:00
|
|
|
SUITE_INIT(efl_ui)
|
|
|
|
{
|
|
|
|
//???
|
|
|
|
}
|
|
|
|
|
|
|
|
SUITE_SHUTDOWN(efl_ui)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-02-26 11:48:24 -08:00
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int failed_count;
|
|
|
|
|
|
|
|
if (!_efl_test_option_disp(argc, argv, etc))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
#ifdef NEED_RUN_IN_TREE
|
|
|
|
putenv("EFL_RUN_IN_TREE=1");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
|
2018-03-27 10:51:13 -07:00
|
|
|
"Efl_Ui", etc, SUITE_INIT_FN(efl_ui), SUITE_SHUTDOWN_FN(efl_ui));
|
2018-02-26 11:48:24 -08:00
|
|
|
|
|
|
|
return (failed_count == 0) ? 0 : 255;
|
|
|
|
}
|