[vala/0.40] tests: Add "version check" tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] tests: Add "version check" tests to increase coverage
- Date: Tue, 21 Apr 2020 07:51:00 +0000 (UTC)
commit d7b652c3b1ee0f1c7527077bc659290c9ec094f7
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 4c079a022..d93b401b8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -828,6 +828,14 @@ LINUX_TESTS = \
linux/bug793444.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)
+
check-TESTS: $(TESTS) $(NON_NULL_TESTS)
@EXEEXT=$(EXEEXT) EXEEXT=$(EXEEXT) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)'
CC='$(CC)' \
$(srcdir)/testrunner.sh $(TESTS)
@@ -837,9 +845,12 @@ if HAVE_LINUX
endif
@EXEEXT=$(EXEEXT) EXEEXT=$(EXEEXT) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)'
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)
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]