diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in index 4471e89d8..72ba30591 100644 --- a/contrib/fwupd.spec.in +++ b/contrib/fwupd.spec.in @@ -24,6 +24,7 @@ BuildRequires: libarchive-devel BuildRequires: gobject-introspection-devel BuildRequires: libappstream-glib-devel >= 0.5.10 BuildRequires: gcab +BuildRequires: valgrind %ifarch x86_64 %{ix86} aarch64 BuildRequires: fwupdate-devel >= 0.5 @@ -79,6 +80,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %find_lang %{name} +%check +make check VERBOSE=1 + %post /sbin/ldconfig %systemd_post fwupd.service diff --git a/src/Makefile.am b/src/Makefile.am index 7767f6ef3..541137999 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,6 @@ AM_CPPFLAGS = \ -DLIBDIR=\"$(libdir)\" \ -DDATADIR=\"$(datadir)\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ -DVERSION="\"$(VERSION)\"" \ -DDAEMON_USER="\"$(daemon_user)\"" \ -DTESTDATADIR=\""$(top_srcdir)/data/tests"\" \ @@ -63,6 +62,7 @@ fwupdmgr_LDFLAGS = \ fwupdmgr_CFLAGS = \ -DFU_OFFLINE_DESTDIR=\"\" \ + -DLOCALSTATEDIR=\""$(localstatedir)"\" \ $(WARNINGFLAGS_C) fu-resources.c: fwupd.gresource.xml $(dist_introspection_DATA) @@ -148,6 +148,7 @@ fwupd_LDFLAGS = \ fwupd_CFLAGS = \ -DFU_OFFLINE_DESTDIR=\"\" \ + -DLOCALSTATEDIR=\""$(localstatedir)"\" \ $(WARNINGFLAGS_C) TESTS_ENVIRONMENT = \ @@ -190,6 +191,7 @@ fu_self_test_LDADD = \ fu_self_test_CFLAGS = \ -DFU_OFFLINE_DESTDIR=\"/tmp/fwupd-self-test\" \ + -DLOCALSTATEDIR=\"/tmp/fwupd-self-test/var\" \ $(WARNINGFLAGS_C) install-data-hook: diff --git a/src/fu-self-test.c b/src/fu-self-test.c index 7af2871d6..098fb9db6 100644 --- a/src/fu-self-test.c +++ b/src/fu-self-test.c @@ -183,6 +183,7 @@ fu_provider_func (void) FwupdResult *res; gboolean ret; guint cnt = 0; + g_autofree gchar *mapped_file_fn = NULL; g_autofree gchar *pending_cap = NULL; g_autofree gchar *pending_db = NULL; g_autoptr(FuDevice) device = NULL; @@ -211,7 +212,8 @@ fu_provider_func (void) "00000000-0000-0000-0000-000000000000"); /* schedule an offline update */ - mapped_file = g_mapped_file_new ("/etc/resolv.conf", FALSE, &error); + mapped_file_fn = fu_test_get_filename ("colorhug/firmware.bin"); + mapped_file = g_mapped_file_new (mapped_file_fn, FALSE, &error); g_assert_no_error (error); g_assert (mapped_file != NULL); blob_cab = g_mapped_file_get_bytes (mapped_file);