ConfigFile is a GLib.KeyFile-like class (and is backed by a KeyFile) that nonetheless provides convenient a high-level API for getting and setting grouped config values and asynchronous loading and saving. * src/engine/util/util-config-file.vala: New ConfigFile class. * src/engine/api/geary-service-information.vala (ServiceInformation): Require ConfigFile groups rather than KeyFile instances for loading and saving. Update subclasses and unit tests. * src/client/accounts/account-manager.vala (AccountManager): Move generic account key consts here from Config. Instead of using KeyFile directly, use ConfigFile groups for loading and saving settings. Rename load and save methods to be a bit more consistent with the class's role, and make save_account() throw its errors so they can be reported to the user. Update call sites. * src/client/accounts/local-service-information.vala (LocalServiceInformation): Move service-specific config key consts here, use new ConfigFile groups for loading and saving. * src/engine/api/geary-config.vala: Removed, all config consts have been moved to the classes using them and KeyFile convenience methods subsumed by ConfigFile.
72 lines
2.7 KiB
Vala
72 lines
2.7 KiB
Vala
/*
|
|
* Copyright 2016-2017 Michael Gratton <mike@vee.net>
|
|
*
|
|
* This software is licensed under the GNU Lesser General Public License
|
|
* (version 2.1 or later). See the COPYING file in this distribution.
|
|
*/
|
|
|
|
int main(string[] args) {
|
|
/*
|
|
* Initialise all the things.
|
|
*/
|
|
|
|
Test.init(ref args);
|
|
|
|
Geary.RFC822.init();
|
|
Geary.HTML.init();
|
|
Geary.Logging.init();
|
|
|
|
/*
|
|
* Hook up all tests into appropriate suites
|
|
*/
|
|
|
|
TestSuite engine = new TestSuite("engine");
|
|
|
|
engine.add_suite(new Geary.AttachmentTest().get_suite());
|
|
engine.add_suite(new Geary.EngineTest().get_suite());
|
|
engine.add_suite(new Geary.IdleManagerTest().get_suite());
|
|
engine.add_suite(new Geary.TimeoutManagerTest().get_suite());
|
|
engine.add_suite(new Geary.App.ConversationTest().get_suite());
|
|
engine.add_suite(new Geary.App.ConversationSetTest().get_suite());
|
|
// Depends on ConversationTest and ConversationSetTest passing
|
|
engine.add_suite(new Geary.App.ConversationMonitorTest().get_suite());
|
|
engine.add_suite(new Geary.Ascii.Test().get_suite());
|
|
engine.add_suite(new Geary.ConfigFileTest().get_suite());
|
|
engine.add_suite(new Geary.Db.DatabaseTest().get_suite());
|
|
engine.add_suite(new Geary.Db.VersionedDatabaseTest().get_suite());
|
|
engine.add_suite(new Geary.HTML.UtilTest().get_suite());
|
|
engine.add_suite(new Geary.Imap.DeserializerTest().get_suite());
|
|
engine.add_suite(new Geary.Imap.CreateCommandTest().get_suite());
|
|
engine.add_suite(new Geary.Imap.NamespaceResponseTest().get_suite());
|
|
engine.add_suite(new Geary.ImapDB.AttachmentTest().get_suite());
|
|
engine.add_suite(new Geary.ImapDB.AttachmentIoTest().get_suite());
|
|
engine.add_suite(new Geary.ImapDB.DatabaseTest().get_suite());
|
|
engine.add_suite(new Geary.ImapEngine.AccountProcessorTest().get_suite());
|
|
engine.add_suite(new Geary.Inet.Test().get_suite());
|
|
engine.add_suite(new Geary.JS.Test().get_suite());
|
|
engine.add_suite(new Geary.Mime.ContentTypeTest().get_suite());
|
|
engine.add_suite(new Geary.RFC822.MailboxAddressTest().get_suite());
|
|
engine.add_suite(new Geary.RFC822.MailboxAddressesTest().get_suite());
|
|
engine.add_suite(new Geary.RFC822.MessageTest().get_suite());
|
|
engine.add_suite(new Geary.RFC822.MessageDataTest().get_suite());
|
|
engine.add_suite(new Geary.RFC822.Utils.Test().get_suite());
|
|
engine.add_suite(new Geary.String.Test().get_suite());
|
|
|
|
/*
|
|
* Run the tests
|
|
*/
|
|
TestSuite root = TestSuite.get_root();
|
|
root.add_suite(engine);
|
|
|
|
MainLoop loop = new MainLoop ();
|
|
|
|
int ret = -1;
|
|
Idle.add(() => {
|
|
ret = Test.run();
|
|
loop.quit();
|
|
return false;
|
|
});
|
|
|
|
loop.run();
|
|
return ret;
|
|
}
|