[gxml] Unit Tests: split DOM from libxml2 implementations



commit df11611bb8355a511257b91c8abb07ad8ce9278c
Author: Daniel Espinosa <esodan gmail com>
Date:   Mon Mar 15 20:27:56 2021 -0600

    Unit Tests: split DOM from libxml2 implementations

 test/GXmlDomTest.vala | 42 ++++++++++++++++++++++++++++++++++++++++++
 test/GXmlTest.vala    |  5 -----
 test/meson.build      | 28 +++++++++++++++++++++-------
 3 files changed, 63 insertions(+), 12 deletions(-)
---
diff --git a/test/GXmlDomTest.vala b/test/GXmlDomTest.vala
new file mode 100644
index 00000000..afd9c8ee
--- /dev/null
+++ b/test/GXmlDomTest.vala
@@ -0,0 +1,42 @@
+/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
+/* GXmlTest.vala
+ *
+ * Copyright (C) 2011-2013  Richard Schwarting <aquarichy gmail com>
+ * Copyright (C) 2011-2019  Daniel Espinosa <esodan gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ *      Richard Schwarting <aquarichy gmail com>
+ *      Daniel Espinosa <esodan gmail com>
+ */
+using GXml;
+
+class GXmlTest {
+       public static int main (string[] args) {
+
+
+               // Sets 29 as fatal flags, 16 + 8 + 4 + 1; bits 0,2,3,4, recursion,error,critical,warning; 
we'll want to undo that warning one so we can catch it
+               Test.init (ref args);
+               DocumentTest.add_tests ();
+               ElementTest.add_tests ();
+               SerializationTest.add_tests ();
+               GomSchemaTest.add_tests ();
+               CssSelectorTest.add_tests ();
+
+               Test.run ();
+
+               return 0;
+       }
+}
diff --git a/test/GXmlTest.vala b/test/GXmlTest.vala
index 2b5cc049..c9fceb97 100644
--- a/test/GXmlTest.vala
+++ b/test/GXmlTest.vala
@@ -34,11 +34,6 @@ class GXmlTest {
                XHtmlDocumentTest.add_tests ();
                DomXDocumentTest.add_tests ();
                XPathTest.add_tests ();
-               DocumentTest.add_tests ();
-               ElementTest.add_tests ();
-               SerializationTest.add_tests ();
-               GomSchemaTest.add_tests ();
-               CssSelectorTest.add_tests ();
 
                Test.run ();
 
diff --git a/test/meson.build b/test/meson.build
index 522c9ebf..c0722165 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -3,22 +3,35 @@ testdirs_dep = declare_dependency (compile_args : [
        '-DTEST_SAVE_DIR="'+meson.current_build_dir()+'"',
 ])
 
-files_tests = files ([
+files_xtests = files ([
                'GXmlTest.vala',
-               'CssSelectorTest.vala',
                'ValaLibxml2Test.vala',
                'XHtmlDocumentTest.vala',
                'DomXDocumentTest.vala',
-               'DocumentTest.vala',
-               'ElementTest.vala',
-               'SerializationTest.vala',
-               'XsdSchemaTest.vala',
                'XElementTest.vala',
                'XPathTest.vala',
        ])
 
 tests_cargs = []
 
+xt = executable('libxml-tests', files_xtests + configvapi + configtestvapi,
+       vala_args : [],
+       c_args: tests_cargs,
+       dependencies : [ libgxml_deps, inc_libh_dep, testdirs_dep, inc_rooth_dep],
+       link_with: libgxml
+)
+
+test ('libxml-tests', xt)
+
+files_tests = files ([
+               'GXmlDomTest.vala',
+               'CssSelectorTest.vala',
+               'DocumentTest.vala',
+               'ElementTest.vala',
+               'SerializationTest.vala',
+               'XsdSchemaTest.vala',
+       ])
+
 t = executable('tests', files_tests + configvapi + configtestvapi,
        vala_args : [],
        c_args: tests_cargs,
@@ -26,7 +39,8 @@ t = executable('tests', files_tests + configvapi + configtestvapi,
        link_with: libgxml
 )
 
-test ('tests', t)
+test ('dom-tests', t)
+
 
 html_tests = files ([
                'HtmlDocumentTest.vala',


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