[vala/0.46] tests: Add "version check" tests to increase coverage



commit 17e809ade5af58cc9eebe1ee17230a20cfecceeb
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Apr 16 14:36:10 2020 +0200

    tests: Add "version check" tests to increase coverage
    
    Use several symbols from glib-2.0 >= 2.50 and refer to custom pkg-config
    file defining 2.48.0 as version.

 tests/Makefile.am                       | 11 +++++++++++
 tests/version/glib-2.0.pc               |  3 +++
 tests/version/since-constant.test       |  5 +++++
 tests/version/since-field.test          |  6 ++++++
 tests/version/since-local-variable.test |  5 +++++
 tests/version/since-method.test         |  5 +++++
 tests/version/since-parameter.test      |  7 +++++++
 7 files changed, 42 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 244c16d2f..1d1739fb9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -906,6 +906,14 @@ LINUX_TESTS = \
        posix/file-commandpipe.vala \
        $(NULL)
 
+VERSION_CHECK_TESTS = \
+       version/since-constant.test \
+       version/since-field.test \
+       version/since-local-variable.test \
+       version/since-method.test \
+       version/since-parameter.test \
+       $(NULL)
+
 GENIE_TESTS = \
        genie/class.gs \
        genie/control-flow-if-do.gs \
@@ -982,11 +990,14 @@ if HAVE_LINUX
 endif
        @EXEEXT=$(EXEEXT) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' 
TEST_CFLAGS='$(TEST_CFLAGS)' CC='$(CC)' \
                VALAFLAGS="--enable-experimental-non-null" $(srcdir)/testrunner.sh $(NON_NULL_TESTS)
+       @export PKG_CONFIG_PATH=$(abs_srcdir)/version; EXEEXT=$(EXEEXT) CFLAGS='$(CFLAGS)' 
CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' \
+               TEST_CFLAGS='$(TEST_CFLAGS)' CC='$(CC)' $(srcdir)/testrunner.sh $(VERSION_CHECK_TESTS)
        @EXEEXT=$(EXEEXT) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' 
TEST_CFLAGS='$(TEST_CFLAGS)' CC='$(CC)' \
                $(srcdir)/testrunner.sh $(GENIE_TESTS)
 
 EXTRA_DIST = \
        testrunner.sh \
+       version/glib-2.0.pc \
        $(TESTS) \
        $(NON_NULL_TESTS) \
        $(LINUX_TESTS) \
diff --git a/tests/version/glib-2.0.pc b/tests/version/glib-2.0.pc
new file mode 100644
index 000000000..2f2e024b7
--- /dev/null
+++ b/tests/version/glib-2.0.pc
@@ -0,0 +1,3 @@
+Name: GLib
+Description: C Utility Library
+Version: 2.48.0
diff --git a/tests/version/since-constant.test b/tests/version/since-constant.test
new file mode 100644
index 000000000..a6dc76606
--- /dev/null
+++ b/tests/version/since-constant.test
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main () {
+       var c = Pid.FORMAT;
+}
diff --git a/tests/version/since-field.test b/tests/version/since-field.test
new file mode 100644
index 000000000..ee8fb5e1e
--- /dev/null
+++ b/tests/version/since-field.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+LogWriterOutput f;
+
+void main () {
+}
diff --git a/tests/version/since-local-variable.test b/tests/version/since-local-variable.test
new file mode 100644
index 000000000..876ca8bc3
--- /dev/null
+++ b/tests/version/since-local-variable.test
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main () {
+       LogWriterOutput l;
+}
diff --git a/tests/version/since-method.test b/tests/version/since-method.test
new file mode 100644
index 000000000..0fd506fce
--- /dev/null
+++ b/tests/version/since-method.test
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main () {
+       debug_here ();
+}
diff --git a/tests/version/since-parameter.test b/tests/version/since-parameter.test
new file mode 100644
index 000000000..eeb8ded88
--- /dev/null
+++ b/tests/version/since-parameter.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+void foo (LogWriterOutput p) {
+}
+
+void main () {
+}


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