source: trunk/base/tests/Makefile @ 16589

Last change on this file since 16589 was 13891, checked in by pguyot (Paul Guyot), 15 years ago

Make distclean work in tests/

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1include ../Mk/dports.autoconf.mk
2
3#SUBDIR=checksums-1 site-tags trace xcodeversion
4SUBDIR=checksums-1 site-tags xcodeversion
5
6.PHONY: test
7
8all:
9
10/tmp/darwinports-tests/opt/local/etc/ports/sources.conf: sources.conf
11        @echo setting up test installation
12        rm -rf /tmp/darwinports-tests/
13        mkdir -p /tmp/darwinports-tests/opt/local/etc/ports/
14        mkdir -p /tmp/darwinports-tests/opt/local/share/
15        mkdir -p /tmp/darwinports-tests/opt/local/var/db/dports/receipts/
16        ln -s $(datadir)/darwinports /tmp/darwinports-tests/opt/local/share/
17        cp sources.conf /tmp/darwinports-tests/opt/local/etc/ports/
18
19clean:
20        rm -rf /tmp/darwinports-tests/
21
22$(bindir)/port:
23        @echo "Please install DarwinPorts before running these tests"
24        @exit 1
25       
26test: /tmp/darwinports-tests/opt/local/etc/ports/sources.conf
27        @for subdir in $(SUBDIR); do\
28                echo ===\> test ${DIRPRFX}$$subdir; \
29                if [ -e ${DIRPRFX}$$subdir/Makefile ]; then \
30                        ( cd $$subdir && \
31                                $(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ PORTSRC=$(PWD)/test-ports.conf test) || exit 1; \
32                else \
33                        ( cd $$subdir && \
34                                PORTSRC=$(PWD)/test-ports.conf $(bindir)/port clean > /dev/null && \
35                                PORTSRC=$(PWD)/test-ports.conf $(bindir)/port test > output 2>&1 \
36                                        || (cat output; exit 1) && \
37                        diff output master 2>&1 | tee difference && \
38                        if [ -s difference ]; then \
39                                exit 1; \
40                        else \
41                                rm -f difference; \
42                        fi) \
43                fi || exit 1; \
44        done
45
46install:
47
48distclean: clean
Note: See TracBrowser for help on using the repository browser.