geary/subprojects/vala-unit/test/test-driver.vala
Michael Gratton 6b1bad28b9 Move generic unit test classes to a new basically-standalone subproject
Break out the generic testing code into something easily re-used, and
improve the API substantially:

 * Use generics to reduce the number of equality tests to effectively
   a single one
 * Make all assert args consistent in that the actual value is always
   listed first.
 * Add convenience API for common string/array/collection assertions
2020-06-30 17:20:12 +10:00

26 lines
609 B
Vala

/*
* Copyright © 2020 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) {
Test.init(ref args);
TestSuite root = TestSuite.get_root();
root.add_suite(new TestAssertions().suite);
root.add_suite(new CollectionAssertions().suite);
MainLoop loop = new MainLoop ();
int ret = -1;
Idle.add(() => {
ret = Test.run();
loop.quit();
return false;
});
loop.run();
return ret;
}