- LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build
- cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/
-
-.PHONY: lib/bup/_version.py
-lib/bup/_version.py:
- rm -f $@ $@.new
- ./format-subst.pl $@.pre >$@.new
- mv $@.new $@
-
-runtests: all runtests-python runtests-cmdline
-
-runtests-python: all
- $(PYTHON) wvtest.py \
- $(wildcard t/t*.py) \
- $(filter-out lib/bup/t/tmetadata.py,$(wildcard lib/*/t/t*.py))
- $(PYTHON) wvtest.py lib/bup/t/tmetadata.py
-
-runtests-cmdline: all
- t/test-index-check-device.sh
- t/test-meta.sh
- t/test-restore-single-file.sh
- t/test-rm-between-index-and-save.sh
- t/test.sh
+ LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" "$(bup_python)" csetup.py build
+ # Make sure there's just the one file we expect before we copy it.
+ find lib/bup/build/* -maxdepth 1 -name '_helpers*$(SOEXT)' \
+ -exec printf 'x' '{}' \; | wc -c | xargs test 1 -eq
+ cp lib/bup/build/*/_helpers*$(SOEXT) "$@"
+
+lib/bup/_checkout.py:
+ @if grep -F '$Format' lib/bup/_release.py \
+ && ! test -e lib/bup/_checkout.py; then \
+ echo "Something has gone wrong; $@ should already exist."; \
+ echo 'Check "./configure-version --update"'; \
+ false; \
+ fi
+
+t/tmp:
+ mkdir t/tmp
+
+runtests: runtests-python runtests-cmdline
+
+# The "pwd -P" here may not be appropriate in the long run, but we
+# need it until we settle the relevant drecurse/exclusion questions:
+# https://groups.google.com/forum/#!topic/bup-list/9ke-Mbp10Q0
+runtests-python: all t/tmp
+ $(pf); cd $$(pwd -P); TMPDIR="$(test_tmp)" \
+ "$(bup_python)" wvtest.py t/t*.py lib/*/t/t*.py 2>&1 \
+ | tee -a t/tmp/test-log/$$$$.log
+
+cmdline_tests := \
+ t/test-ftp \
+ t/test-save-restore \
+ t/test-packsizelimit \
+ t/test-prune-older \
+ t/test-web.sh \
+ t/test-rm.sh \
+ t/test-gc.sh \
+ t/test-main.sh \
+ t/test-list-idx.sh \
+ t/test-index.sh \
+ t/test-split-join.sh \
+ t/test-fuse.sh \
+ t/test-drecurse.sh \
+ t/test-cat-file.sh \
+ t/test-compression.sh \
+ t/test-fsck.sh \
+ t/test-index-clear.sh \
+ t/test-index-check-device.sh \
+ t/test-ls \
+ t/test-ls-remote \
+ t/test-tz.sh \
+ t/test-meta.sh \
+ t/test-on.sh \
+ t/test-restore-map-owner.sh \
+ t/test-restore-single-file.sh \
+ t/test-rm-between-index-and-save.sh \
+ t/test-save-with-valid-parent.sh \
+ t/test-sparse-files.sh \
+ t/test-command-without-init-fails.sh \
+ t/test-redundant-saves.sh \
+ t/test-save-creates-no-unrefs.sh \
+ t/test-save-restore-excludes.sh \
+ t/test-save-strip-graft.sh \
+ t/test-import-duplicity.sh \
+ t/test-import-rdiff-backup.sh \
+ t/test-xdev.sh \
+ t/test.sh
+
+# For parallel runs.
+# The "pwd -P" here may not be appropriate in the long run, but we
+# need it until we settle the relevant drecurse/exclusion questions:
+# https://groups.google.com/forum/#!topic/bup-list/9ke-Mbp10Q0
+tmp-target-run-test%: all t/tmp
+ $(pf); cd $$(pwd -P); 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))