Break out test into two parts: test or sudotest.

The latter will invoke tests with sudo. Not all builds
can support this, but we do need a convenient way
to test this stuff...

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
This commit is contained in:
Andrew G. Morgan 2019-12-15 10:52:55 -08:00
parent 2b5f5635be
commit dada271ca4
4 changed files with 14 additions and 1 deletions

View File

@ -41,6 +41,13 @@ ifeq ($(GOLANG),yes)
endif
make -C progs test
sudotest: all
make -C tests sudotest
ifeq ($(GOLANG),yes)
make -C go sudotest
endif
make -C progs sudotest
morganrelease: distclean
@echo "sign the tag twice: older DSA key; and newer RSA kernel.org key"
git tag -u D41A6DF2 -s libcap-$(VERSION).$(MINOR) -m "This is libcap-$(VERSION).$(MINOR)"

View File

@ -40,7 +40,7 @@ $(CAPGOPACKAGE): src/libcap/cap/syscalls.go src/libcap/cap/names.go src/libcap/c
CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) go install libcap/cap
# Compiles something with this package to compare it to libcap. This
# tests more when run under sudo (see ../progs/quicktest.sh for that).
# tests more when run under sudotest (see ../progs/quicktest.sh for that).
compare-cap: compare-cap.go $(CAPGOPACKAGE)
CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) go build $<
@ -57,6 +57,8 @@ test: all
CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) go test libcap/cap
./compare-cap
sudotest: test
install: all
mkdir -p $(FAKEROOT)$(GOPKGDIR)/libcap/psx
rm -f $(FAKEROOT)$(GOPKGDIR)/libcap/psx/*

View File

@ -35,6 +35,8 @@ ifeq ($(RAISE_SETFCAP),yes)
endif
test: $(PROGS)
sudotest: test
sudo ./quicktest.sh
clean:

View File

@ -14,6 +14,8 @@ $(DEPS):
test: run_psx_test run_libcap_psx_test
sudotest: test
install: all
run_psx_test: psx_test psx_test_wrap