# include <config.h>
#endif
+#include <stdio.h>
+
#include <Eo.h>
-#include <Eio.h>
#include <Ecore.h>
#include <Efl.h>
+#include <Eio.h>
#include <eio_model.h>
-#include <stdio.h>
-#include <check.h>
+#include "eio_suite.h"
#define EFL_MODEL_TEST_FILENAME_PATH "/tmp"
#define EFL_MODEL_MAX_TEST_CHILDS 16
handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, NULL);
ecore_main_loop_begin();
-
+
eo_do(filemodel, status = efl_model_property_get("filename", &value_prop));
str = eina_value_to_string(value_prop);
printf("efl_model_test filename %s, load status %d\n", str, status);
{
tcase_add_test(tc, eio_model_test_test_file);
}
-
# include <config.h>
#endif
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <Eio.h>
-
#include "eio_suite.h"
+#include "../efl_check.h"
-typedef struct _Eio_Test_Case Eio_Test_Case;
-
-struct _Eio_Test_Case
-{
- const char *test_case;
- void (*build)(TCase *tc);
-};
-
-static const Eio_Test_Case etc[] = {
+static const Efl_Test_Case etc[] = {
{"Eio_Monitor", eio_test_monitor},
{"Eio Model", eio_model_test_file},
{"Eio Model Monitor", eio_model_test_monitor_add},
{NULL, NULL}
};
-static void
-_list_tests(void)
-{
- const Eio_Test_Case *itr;
-
- itr = etc;
- fputs("Available Test Cases:\n", stderr);
- for (; itr->test_case; itr++)
- fprintf(stderr, "\t%s\n", itr->test_case);
-}
-
-static Eina_Bool
-_use_test(int argc, const char **argv, const char *test_case)
-{
- if (argc < 1)
- return 1;
-
- for (; argc > 0; argc--, argv++)
- if (strcmp(test_case, *argv) == 0)
- return 1;
- return 0;
-}
-
-static Suite *
-eio_suite_build(int argc, const char **argv)
-{
- TCase *tc;
- Suite *s;
- int i;
-
- s = suite_create("Eio");
-
- for (i = 0; etc[i].test_case; ++i)
- {
- if (!_use_test(argc, argv, etc[i].test_case)) continue;
- tc = tcase_create(etc[i].test_case);
-
- etc[i].build(tc);
-
- suite_add_tcase(s, tc);
- tcase_set_timeout(tc, 0);
- }
-
- return s;
-}
-
-
int
main(int argc, char **argv)
{
- Suite *s;
- SRunner *sr;
- int i, failed_count;
+ int failed_count;
- for (i = 1; i < argc; i++)
- if ((strcmp(argv[i], "-h") == 0) ||
- (strcmp(argv[i], "--help") == 0))
- {
- fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n",
- argv[0]);
- _list_tests();
- return 0;
- }
- else if ((strcmp(argv[i], "-l") == 0) ||
- (strcmp(argv[i], "--list") == 0))
- {
- _list_tests();
- return 0;
- }
+ if (!_efl_test_option_disp(argc, argv, etc))
+ return 0;
putenv("EFL_RUN_IN_TREE=1");
- s = eio_suite_build(argc - 1, (const char **)argv + 1);
- sr = srunner_create(s);
-
- srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml");
-
- srunner_run_all(sr, CK_ENV);
- failed_count = srunner_ntests_failed(sr);
- srunner_free(sr);
+ failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
+ "Eio", etc);
return (failed_count == 0) ? 0 : 255;
}
#include <unistd.h>
#include <string.h>
-#include <Eio.h>
#include <Ecore.h>
#include <Ecore_File.h>
+#include <Eio.h>
#include "eio_suite.h"
//monitor directory
monitor = eio_monitor_add(filename);
-
+
usleep(500000);
-
+
eio_monitor_del(monitor);
_common_shutdown(dirname);
//monitor directory
monitor1 = eio_monitor_add(filename);
eio_monitor_del(monitor1);
-
+
usleep(500000);
-
+
monitor2 = eio_monitor_add(filename);
eio_monitor_del(monitor2);
usleep(500000);
//monitor directory
- monitor1 = eio_monitor_add(filename1);
+ monitor1 = eio_monitor_add(filename1);
monitor2 = eio_monitor_add(filename2);
usleep(500000);
eio_monitor_del(monitor2);
tcase_add_test(tc, eio_test_monitor_add_and_remove);
tcase_add_test(tc, eio_test_monitor_add_remove_add);
tcase_add_test(tc, eio_test_monitor_add_add_remove_remove);
-
+
tcase_add_test(tc, eio_test_monitor_directory_file_created_notify);
tcase_add_test(tc, eio_test_monitor_directory_file_deleted_notify);
tcase_add_test(tc, eio_test_monitor_directory_file_modified_notify);