Top |
Functions
#define | E_TEST_SERVER_UTILS_SERVICE() |
void | (*ETestSourceCustomizeFunc) () |
void | e_test_server_utils_setup () |
void | e_test_server_utils_teardown () |
gint | e_test_server_utils_run () |
gint | e_test_server_utils_run_full () |
Types and Values
enum | ETestServiceType |
struct | ETestServerClosure |
ETestService | |
struct | ETestServerFixture |
enum | ETestServerFlags |
Description
This test fixture provides an encapsulated testing environment for test cases to test EBookClient and ECalClient.
The ETestServerFixture should be used as a fixture and must be coupled with the ETestServerClosure to configure how the test fixture will operate.
Both the ETestServerFixture and ETestServerClosure can be extended with
more complex test fixtures, which must remember to call e_test_server_utils_setup()
and e_test_server_utils_teardown()
in thier fixture's setup and teardown routines.
Functions
E_TEST_SERVER_UTILS_SERVICE()
#define E_TEST_SERVER_UTILS_SERVICE(fixture, service_type)
A convenience macro to fetch the service for a given test case:
1 |
EBookClient *book = E_TEST_SERVER_UTILS_SERVICE (fixture, EBookClient); |
ETestSourceCustomizeFunc ()
void (*ETestSourceCustomizeFunc) (ESource *scratch
,ETestServerClosure *closure
);
This can be used to parameterize the addressbook or calendar scratch
ESource
before creating/committing it.
Parameters
scratch |
The scratch ESource template being used to create an addressbook or calendar |
|
closure |
The ETestServerClosure for this test case |
e_test_server_utils_setup ()
void e_test_server_utils_setup (ETestServerFixture *fixture
,gconstpointer user_data
);
A setup function for the ETestServerFixture fixture
e_test_server_utils_teardown ()
void e_test_server_utils_teardown (ETestServerFixture *fixture
,gconstpointer user_data
);
A teardown function for the ETestServerFixture fixture
Types and Values
enum ETestServiceType
The type of service to test
Members
Only the ESourceRegistry will be created |
||
An EBookCLient will be created and opened for the test |
||
An EBookCLient in direct read access mode will be created and opened for the test |
||
An ECalClient will be created and opened for the test |
||
An EBook will be created and opened for the test |
||
struct ETestServerClosure
struct ETestServerClosure { ETestServiceType type; ETestSourceCustomizeFunc customize; gint calendar_source_type; gboolean keep_work_directory; GDestroyNotify destroy_closure_func; gboolean use_async_connect; };
This structure provides the parameters for the ETestServerFixture tests, it can be included as the first member of a derived structure for any tests deriving from the ETestServerFixture test type
Members
ETestServiceType |
||
ETestSourceCustomizeFunc |
An ETestSourceCustomizeFunc to use to parameterize the scratch ESource, or |
|
gint |
An ECalClientSourceType or ECalSourceType; for |
|
gboolean |
If specified, the work directory will not be deleted between tests |
|
GDestroyNotify |
A function to destroy an allocated ETestServerClosure, this it typically used by sub-fixtures which embed this structure in their closures. |
|
gboolean |
Specifies whether a synchronous or asyncrhonous API should be used to create the EClient you plan to test. |
ETestService
A union of service types, holds the object to test in a ETestServerFixture.
Members
gpointer |
A generic pointer for the test service. |
|
EBookClient * |
An EBookClient, created for |
|
ECalClient * |
An ECalClient, created for |
|
EBook * |
An EBook, created for |
|
ECal * |
An ECal, created for |
struct ETestServerFixture
struct ETestServerFixture { GMainLoop *loop; GTestDBus *dbus; ESourceRegistry *registry; ETestService service; gchar *source_name; };
A fixture for running tests on the Evolution Data Server components in an encapsulated D-Bus environment.
Members
GMainLoop * |
A Main loop to run traffic in |
|
GTestDBus * |
The D-Bus test scaffold |
|
ESourceRegistry * |
||
ETestService |
The ETestService |
|
gchar * |
This can be given an allocated string before calling |