Skip to content

Commit

Permalink
data, packaging: separate check and implicit build makefile targets (#…
Browse files Browse the repository at this point in the history
…14964)

* data: add top level check target, do not run checks implicitly for all

Add a separate check target in the top level Makefile and run check for
data/systemd, which is the only directory where checks are implemented.

Signed-off-by: Maciej Borzecki <[email protected]>

* packaging: run checks in data

Signed-off-by: Maciej Borzecki <[email protected]>

* packaging/arch: drop unnecessary trailing /

Signed-off-by: Maciej Borzecki <[email protected]>

---------

Signed-off-by: Maciej Borzecki <[email protected]>
  • Loading branch information
bboozzoo authored Jan 23, 2025
1 parent e7a49b9 commit b85fde1
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ all install clean:
$(MAKE) -C env $@
$(MAKE) -C desktop $@
$(MAKE) -C polkit $@

check:
$(MAKE) -C systemd $@
2 changes: 1 addition & 1 deletion data/systemd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SYSTEMD_UNITS_GENERATED := $(wildcard *.in)
SYSTEMD_UNITS = $(sort $(SYSTEMD_UNITS_GENERATED:.in=) $(wildcard *.service) $(wildcard *.timer) $(wildcard *.socket) $(wildcard *.target))

.PHONY: all
all: $(SYSTEMD_UNITS) check
all: $(SYSTEMD_UNITS)

.PHONY: check
check: snapd.run-from-snap snapd.core-fixup.sh
Expand Down
3 changes: 2 additions & 1 deletion packaging/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ check() {
# done, not after building the tree.
# ./run-checks --static
TMPDIR=/tmp make -C cmd -k check
TMPDIR=/tmp make -C data -k check
}

package() {
Expand All @@ -133,7 +134,7 @@ package() {
"$pkgdir/usr/share/zsh/site-functions/_snap"

# Install systemd units, dbus services and a script for environment variables
make -C data/ install \
make -C data install \
DBUSSERVICESDIR=/usr/share/dbus-1/services \
BINDIR=/usr/bin \
SYSTEMDSYSTEMUNITDIR=/usr/lib/systemd/system \
Expand Down
6 changes: 3 additions & 3 deletions packaging/fedora/snapd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,9 @@ export GO111MODULE=off
%endif

# snap-confine tests (these always run!)
pushd ./cmd
make check
popd
make -C cmd -k check
# and data files
make -C data -k check

%files
#define license tag if not already defined
Expand Down
3 changes: 2 additions & 1 deletion packaging/opensuse/snapd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ for binary in snap-exec snap-update-ns snapctl; do
ldd $binary 2>&1 | grep 'not a dynamic executable'
done

%make_build -C %{indigo_srcdir}/cmd check
%make_build -C %{indigo_srcdir}/cmd -k check
%make_build -C %{indigo_srcdir}/data -k check
# Use the common packaging helper for testing.
%make_build -C %{indigo_srcdir} -f %{indigo_srcdir}/packaging/snapd.mk \
GOPATH=%{indigo_gopath}:$GOPATH SNAPD_DEFINES_DIR=%{_builddir} \
Expand Down
4 changes: 3 additions & 1 deletion packaging/ubuntu-14.04/rules
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
endif
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# run the snap-confine tests
$(MAKE) -C cmd check
$(MAKE) -C cmd -k check
# and data files tests
$(MAKE) -C data -k check
endif

override_dh_install:
Expand Down
4 changes: 3 additions & 1 deletion packaging/ubuntu-16.04/rules
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
endif
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# run the snap-confine tests
$(MAKE) -C cmd check
$(MAKE) -C cmd -k check
# and data files tests
$(MAKE) -C data -k check
endif


Expand Down

0 comments on commit b85fde1

Please sign in to comment.