diff options
author | Andrei Belov <defan@nginx.com> | 2018-01-26 17:44:26 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2018-01-26 17:44:26 +0300 |
commit | 9d1410a0bb0ebe792eb3e26ac757dd78847b705e (patch) | |
tree | 2c8da8379d100349361748797a3741fe1343fdbb /pkg/rpm/Makefile | |
parent | 7fe8f72364fbac68cd82abf8fc775cce965a4a1e (diff) | |
download | unit-9d1410a0bb0ebe792eb3e26ac757dd78847b705e.tar.gz unit-9d1410a0bb0ebe792eb3e26ac757dd78847b705e.tar.bz2 |
Packages: "test" and "test-debug" targets for rpm.
Diffstat (limited to 'pkg/rpm/Makefile')
-rw-r--r-- | pkg/rpm/Makefile | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index a5d463c9..03fa1574 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -50,7 +50,7 @@ CONFIGURE_ARGS=\ export CR=\\n default: - @echo "valid targets: all modules unit $(addprefix unit-, $(MODULES)) rpmlint specs clean" + @echo "valid targets: all modules unit $(addprefix unit-, $(MODULES)) rpmlint specs test test-debug clean" all: check-build-depends unit modules @@ -172,11 +172,31 @@ unit-%: check-build-depends-% rpmbuild/SPECS/unit-%.spec rpmbuild/SOURCES/unit-$ rpmbuild -D "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/$@.spec && \ ln -s rpmbuild/BUILD/$@-$(VERSION)/build $@ +test: unit modules + @{ \ + for so in `find rpmbuild/BUILD/*/build-nodebug/ -type f -name "*.so"`; do \ + soname=`basename $${so}` ; \ + test -h rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} || \ + ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} ; \ + done ; \ + ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && ./test/run.py ) ; \ + } + +test-debug: unit modules + @{ \ + for so in `find rpmbuild/BUILD/*/build-debug/ -type f -name "*.so"`; do \ + soname=`basename $${so}` ; \ + test -h rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} || \ + ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} ; \ + done ; \ + ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-debug build && ./test/run.py ) ; \ + } + clean: rm -rf rpmbuild/SPECS rpmbuild/BUILD rpmbuild/BUILDROOT rpmbuild/RPMS rpmbuild/SRPMS ../../build rm -f rpmbuild/SOURCES/unit-*.tar.gz unit find . -maxdepth 1 -type l -delete -.PHONY: default all modules specs check-build-depends rpmlint clean +.PHONY: default all modules specs check-build-depends rpmlint test test-debug clean .SECONDARY: |