summaryrefslogtreecommitdiff
path: root/test/run-tests.h
diff options
context:
space:
mode:
authorP. F. Chimento <philip.chimento@gmail.com>2013-04-18 16:32:33 +0200
committerP. F. Chimento <philip.chimento@gmail.com>2013-04-24 14:48:15 +0200
commit60bf094db89ab098a7d56169c8657f7a26dd7590 (patch)
tree360daa05c10bd1e068559696ae96a422fceb3907 /test/run-tests.h
parent096c63f7ed002b99a995c35a407483a0bfa161c5 (diff)
Test fixture for testing an application window
Test harness improvement: ADD_APP_WINDOW_TEST(test_path, test_func) creates an EosApplication and connects test_func() to the "startup" handler of the application, then runs it. Commented out /application/two-windows test, because it's apparently not deterministic.
Diffstat (limited to 'test/run-tests.h')
-rw-r--r--test/run-tests.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/test/run-tests.h b/test/run-tests.h
index 1d4c402..e60000f 100644
--- a/test/run-tests.h
+++ b/test/run-tests.h
@@ -3,9 +3,29 @@
#ifndef RUN_TESTS_H
#define RUN_TESTS_H
-void add_init_tests (void);
-void add_hello_tests (void);
-void add_application_tests (void);
-void add_window_tests (void);
+#define TEST_APPLICATION_ID "com.endlessm.example.test"
+
+#define ADD_APP_WINDOW_TEST(path, test_func) \
+ g_test_add ((path), AppWindowTestFixture, (test_func), \
+ app_window_test_fixture_setup, \
+ app_window_test_fixture_test, \
+ app_window_test_fixture_teardown);
+
+typedef struct
+{
+ EosApplication *app;
+} AppWindowTestFixture;
+
+void app_window_test_fixture_setup (AppWindowTestFixture *fixture,
+ gconstpointer callback);
+void app_window_test_fixture_test (AppWindowTestFixture *fixture,
+ gconstpointer unused);
+void app_window_test_fixture_teardown (AppWindowTestFixture *fixture,
+ gconstpointer unused);
+
+void add_init_tests (void);
+void add_hello_tests (void);
+void add_application_tests (void);
+void add_window_tests (void);
#endif /* RUN_TESTS_H */