summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-10-15 18:27:38 +0200
committerAlexander Larsson <alexl@redhat.com>2020-10-23 17:24:22 +0200
commit3a06e7c7ded311c633c57636dc945f105c64df9b (patch)
tree488d3e05d6102938e1a79ade81d6ef0ecc857678
parent189fd3d903960462ddd05fb39a66cb53ec5181f3 (diff)
downloadflatpak-3a06e7c7ded311c633c57636dc945f105c64df9b.tar.gz
Add --enable-internal-checks option and use in CI
This enables the internal checks in the generated variant parser.
-rw-r--r--.github/workflows/check.yml2
-rw-r--r--common/Makefile.am.inc7
-rw-r--r--configure.ac11
3 files changed, 18 insertions, 2 deletions
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 08a6e6f5..3fd11e63 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -49,7 +49,7 @@ jobs:
- name: Create logs dir
run: mkdir test-logs
- name: autogen.sh
- run: NOCONFIGURE=1 ./autogen.sh
+ run: NOCONFIGURE=1 ./autogen.sh --enable-internal-checks
- name: configure
# TODO: Enable gtk-doc builds
run: |
diff --git a/common/Makefile.am.inc b/common/Makefile.am.inc
index 82d85ad7..85462acb 100644
--- a/common/Makefile.am.inc
+++ b/common/Makefile.am.inc
@@ -75,8 +75,13 @@ nodist_libflatpak_common_base_la_SOURCES = \
BUILT_SOURCES += $(nodist_libflatpak_common_base_la_SOURCES)
CLEANFILES += $(nodist_libflatpak_common_base_la_SOURCES)
+VARIANT_SCHEMA_COMPILER_FLAGS=
+if ENABLE_INTERNAL_CHECKS
+VARIANT_SCHEMA_COMPILER_FLAGS += --internal-validation
+endif
+
common/flatpak-variant-private.h: variant-schema-compiler/variant-schema-compiler data/flatpak-variants.gv
- $(AM_V_GEN) $(srcdir)/variant-schema-compiler/variant-schema-compiler --outfile-header common/flatpak-variant-private.h --outfile common/flatpak-variant-impl-private.h --prefix var $(srcdir)/data/flatpak-variants.gv
+ $(AM_V_GEN) $(srcdir)/variant-schema-compiler/variant-schema-compiler $(VARIANT_SCHEMA_COMPILER_FLAGS) --outfile-header common/flatpak-variant-private.h --outfile common/flatpak-variant-impl-private.h --prefix var $(srcdir)/data/flatpak-variants.gv
# Generated by the same tool at the same time
common/flatpak-variant-impl-private.h: common/flatpak-variant-private.h
diff --git a/configure.ac b/configure.ac
index e0069312..0693bb01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -508,6 +508,17 @@ if test x$use_lcov = xyes; then
LDFLAGS="$LDFLAGS -lgcov"
fi
+AC_ARG_ENABLE(internal-checks,
+ AS_HELP_STRING([--enable-internal-checks],
+ [enable internal checking]),
+ [use_internal_checks=$enableval], [use_internal_checks=no])
+
+if test x$use_internal_checks = xyes; then
+ AM_CONDITIONAL([ENABLE_INTERNAL_CHECKS], [true])
+else
+ AM_CONDITIONAL([ENABLE_INTERNAL_CHECKS], [false])
+fi
+
GLIB_TESTS
FLATPAK_MAJOR_VERSION=flatpak_major_version