On Thu, 2011-01-27 at 08:15 +0100, Patrick Ohly wrote:
> On Mi, 2011-01-26 at 11:34 -0500, Matthew Barnes wrote:
> > Can you elaborate on the creation use case?  Sounds like you're creating
> > local data sources on the fly?
> 
> Yes. The primary use case is in automated testing. Instead of having to
> create the database in advance via the GUI, the test driver does it
> automatically.

For automated testing you could either predefine a set of key files --
each of which pointing to a different .ics file -- or generate the key
files on the fly.  Haven't nailed down the exact format of the backend
group yet but it would look something like:

        [Data Source]
        Parent=local
        DisplayName=Test 1
        
        [Calendar]
        Color=#whatever
        Enabled=true
        
        [File Backend]
        Location=file://path/to/test.ics

The test fixture would then load the directory containing these key
files into the registry:

        ESourceRegistry *registry;
        GList *sources, *iter;
        
        registry = e_source_registry_get_default ();
        
        e_source_registry_load_directory (registry,
        "/path/to/key-files");
        
        /* Give me all the test ESources. */
        sources = e_sources_registry_list_sources (registry, NULL);
        
        /* Run each test. */
        for (iter = sources; iter != NULL; iter = g_list_next (iter))
                run_test (E_SOURCE (iter->data));
        
        g_list_free (sources);
        

_______________________________________________
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers

Reply via email to