[geary/bug/776421-make-client-unit-testable: 7/8] Add client lib to the test build.



commit 325232bad7315f19420a6446fcd248fe601418de
Author: Michael James Gratton <mike vee net>
Date:   Mon Dec 26 13:18:51 2016 +1030

    Add client lib to the test build.
    
    * test/CMakeLists.txt: Add client lib and dependent packages to the
      build.
    
    * test/main.vala (main): Add test suites  for both client and engine
      tests to allow some more fine-grained control when running them. Also
      add some sectioning doc comments.

 test/CMakeLists.txt |   15 +++++++++++++--
 test/main.vala      |   30 +++++++++++++++++++++++-------
 2 files changed, 36 insertions(+), 9 deletions(-)
---
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8e90dc0..4122212 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -24,10 +24,21 @@ pkg_check_modules(DEPS REQUIRED
   glib-2.0
   gmime-2.6
   gthread-2.0
+  gtk+-3.0
+  libsoup-2.4
+  webkitgtk-3.0
 )
 
 set(TEST_PACKAGES
-  glib-2.0 gio-2.0 gee-0.8 gmime-2.6 geary-engine
+  geary-client
+  geary-engine
+  gee-0.8
+  gio-2.0
+  glib-2.0
+  gmime-2.6
+  gtk+-3.0
+  libsoup-2.4
+  webkitgtk-3.0
 )
 
 set(CFLAGS
@@ -65,4 +76,4 @@ OPTIONS
 )
 
 add_executable(geary-test ${TEST_VALA_C})
-target_link_libraries(geary-test ${DEPS_LIBRARIES} geary-engine)
+target_link_libraries(geary-test ${DEPS_LIBRARIES} geary-client geary-engine)
diff --git a/test/main.vala b/test/main.vala
index d088d23..34e9b18 100644
--- a/test/main.vala
+++ b/test/main.vala
@@ -6,19 +6,35 @@
  */
 
 int main(string[] args) {
+    /*
+     * Initialise all the things.
+     */
+
     Test.init(ref args);
 
     Geary.RFC822.init();
     Geary.HTML.init();
 
-    TestSuite root = TestSuite.get_root();
+    /*
+     * Hook up all tests into appropriate suites
+     */
+
+    TestSuite engine = new TestSuite("engine");
 
-    // Engine tests
-    root.add_suite(new Geary.HTML.UtilTest().get_suite());
-    root.add_suite(new Geary.RFC822.MailboxAddressTest().get_suite());
-    root.add_suite(new Geary.RFC822.MessageTest().get_suite());
-    root.add_suite(new Geary.RFC822.MessageDataTest().get_suite());
-    root.add_suite(new Geary.RFC822.Utils.Test().get_suite());
+    engine.add_suite(new Geary.HTML.UtilTest().get_suite());
+    engine.add_suite(new Geary.RFC822.MailboxAddressTest().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());
+
+    TestSuite client = new TestSuite("client");
+
+    /*
+     * Run the tests
+     */
+    TestSuite root = TestSuite.get_root();
+    root.add_suite(engine);
+    root.add_suite(client);
 
     return Test.run();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]