X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=daefc0808edb109bd585e62d9880d7ffcce1c602;hb=e2073c04660032cf32e3092cfa013c987c589c14;hp=c15adfb9b5968f5178daff2d1b247418a7062eea;hpb=b76c62babe6791d2ee2862993356900a7b581ec2;p=bup.git diff --git a/Makefile b/Makefile index c15adfb..daefc08 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ + +sampledata_rev := $(shell t/configure-sampledata --revision) +current_sampledata := t/sampledata/var/rev/v$(sampledata_rev) + OS:=$(shell uname | sed 's/[-_].*//') CFLAGS := -Wall -O2 -Werror -Wno-unknown-pragmas $(PYINCLUDE) $(CFLAGS) CFLAGS := -D_FILE_OFFSET_BITS=64 $(CFLAGS) @@ -13,14 +17,18 @@ else test_tmp := $(CURDIR)/t/tmp endif -.PHONY: all -all: bup Documentation/all - t/configure-sampledata --setup +initial_setup := $(shell ./configure-version --update) +bup_deps := bup lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds -bup: lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds main.py - ln -sf main.py bup +all: $(bup_deps) Documentation/all $(current_sampledata) -Documentation/all: bup +bup: + ln -s main.py bup + +Documentation/all: $(bup_deps) + +$(current_sampledata): + t/configure-sampledata --setup INSTALL=install PYTHON=python @@ -75,14 +83,10 @@ lib/bup/_helpers$(SOEXT): \ LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/ -# This must be completely atomic since it may be run (often) in -# parallel when "-j" is specified, either via targets here, or via -# tests that use an install tree as data. -.PHONY: lib/bup/_version.py lib/bup/_version.py: - rm -f $@.tmp-$$$$ \ - && ./format-subst.pl $@.pre > $@.tmp-$$$$ \ - && (if ! test -e $@ || ! cmp $@ $@.tmp-$$$$; then mv $@.tmp-$$$$ $@; fi) + @echo "Something has gone wrong; $@ should already exist." + @echo 'Check "./configure-version --update"' + @false t/tmp: mkdir t/tmp @@ -90,9 +94,12 @@ t/tmp: runtests: runtests-python runtests-cmdline runtests-python: all t/tmp - TMPDIR="$(test_tmp)" $(PYTHON) wvtest.py t/t*.py lib/*/t/t*.py + TMPDIR="$(test_tmp)" $(PYTHON) wvtest.py t/t*.py lib/*/t/t*.py 2>&1 \ + | tee -a t/tmp/test-log/$$$$.log cmdline_tests := \ + t/test-index.sh \ + t/test-split-join.sh \ t/test-fuse.sh \ t/test-drecurse.sh \ t/test-cat-file.sh \ @@ -101,6 +108,7 @@ cmdline_tests := \ t/test-index-clear.sh \ t/test-index-check-device.sh \ t/test-ls.sh \ + t/test-tz.sh \ t/test-meta.sh \ t/test-on.sh \ t/test-restore-map-owner.sh \ @@ -118,16 +126,20 @@ cmdline_tests := \ t/test.sh # For parallel runs. -tmp-target-run-test-%: all t/tmp - TMPDIR="$(test_tmp)" t/test-$* +tmp-target-run-test%: all t/tmp + TMPDIR="$(test_tmp)" t/test$* 2>&1 | tee -a t/tmp/test-log/$$$$.log -runtests-cmdline: $(subst t/test-,tmp-target-run-test-,$(cmdline_tests)) +runtests-cmdline: $(subst t/test,tmp-target-run-test,$(cmdline_tests)) stupid: PATH=/bin:/usr/bin $(MAKE) test test: all - ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests-python runtests-cmdline + if test -e t/tmp/test-log; then rm -r t/tmp/test-log; fi + mkdir -p t/tmp/test-log + ./wvtest watch --no-counts \ + $(MAKE) PYTHON=$(PYTHON) runtests-python runtests-cmdline + ./wvtest report t/tmp/test-log/*.log check: test @@ -177,7 +189,6 @@ clean: Documentation/clean config/clean .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \ *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \ bup bup-* cmd/bup-* \ - lib/bup/_version.py lib/bup/_version.py.tmp-* \ randomgen memtest \ testfs.img lib/bup/t/testfs.img if test -e t/mnt; then t/cleanup-mounts-under t/mnt; fi @@ -188,4 +199,5 @@ clean: Documentation/clean config/clean then umount lib/bup/t/testfs || true; fi rm -rf *.tmp *.tmp.meta t/*.tmp lib/*/*/*.tmp build lib/bup/build lib/bup/t/testfs if test -e t/tmp; then t/force-delete t/tmp; fi + ./configure-version --clean t/configure-sampledata --clean