]> arthur.barton.de Git - bup.git/blobdiff - Makefile
README: reflect report that WSL works fine
[bup.git] / Makefile
index 8a4a441f49ae9a13b9becb969f30737f059ea417..e45719d6118027d5d841c31370920dfdd07ea710 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -159,113 +159,26 @@ lib/bup/_helpers$(SOEXT): \
 test/tmp:
        mkdir test/tmp
 
-runtests: runtests-python runtests-cmdline
-
-python_tests := \
-  test/int/test_bloom.py \
-  test/int/test_client.py \
-  test/int/test_compat.py \
-  test/int/test_git.py \
-  test/int/test_hashsplit.py \
-  test/int/test_helpers.py \
-  test/int/test_index.py \
-  test/int/test_metadata.py \
-  test/int/test_options.py \
-  test/int/test_resolve.py \
-  test/int/test_shquote.py \
-  test/int/test_vfs.py \
-  test/int/test_vint.py \
-  test/int/test_xstat.py
-
-
-# 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 test/tmp
-       mkdir -p test/tmp/test-log
-       $(pf); cd $$(pwd -P); TMPDIR="$(test_tmp)" \
-         ./wvtest.py  $(python_tests) 2>&1 \
-           | tee -a test/tmp/test-log/$$$$.log
-
-cmdline_tests := \
-  test/ext/test.sh \
-  test/ext/test-argv \
-  test/ext/test-cat-file.sh \
-  test/ext/test-command-without-init-fails.sh \
-  test/ext/test-compression.sh \
-  test/ext/test-drecurse.sh \
-  test/ext/test-fsck.sh \
-  test/ext/test-fuse.sh \
-  test/ext/test-ftp \
-  test/ext/test-help \
-  test/ext/test-web.sh \
-  test/ext/test-gc.sh \
-  test/ext/test-import-duplicity.sh \
-  test/ext/test-import-rdiff-backup.sh \
-  test/ext/test-index.sh \
-  test/ext/test-index-check-device.sh \
-  test/ext/test-index-clear.sh \
-  test/ext/test-list-idx.sh \
-  test/ext/test-ls \
-  test/ext/test-ls-remote \
-  test/ext/test-main.sh \
-  test/ext/test-meta.sh \
-  test/ext/test-on.sh \
-  test/ext/test-packsizelimit \
-  test/ext/test-prune-older \
-  test/ext/test-redundant-saves.sh \
-  test/ext/test-restore-map-owner.sh \
-  test/ext/test-restore-single-file.sh \
-  test/ext/test-rm.sh \
-  test/ext/test-rm-between-index-and-save.sh \
-  test/ext/test-save-creates-no-unrefs.sh \
-  test/ext/test-save-restore \
-  test/ext/test-save-errors \
-  test/ext/test-save-restore-excludes.sh \
-  test/ext/test-save-strip-graft.sh \
-  test/ext/test-save-with-valid-parent.sh \
-  test/ext/test-sparse-files.sh \
-  test/ext/test-split-join.sh \
-  test/ext/test-tz.sh \
-  test/ext/test-xdev.sh
-
-tmp-target-run-test-get-%: all test/tmp
-       $(pf); cd $$(pwd -P); TMPDIR="$(test_tmp)" \
-         test/ext/test-get $* 2>&1 | tee -a test/tmp/test-log/$$$$.log
-
-test_get_targets += \
-  tmp-target-run-test-get-replace \
-  tmp-target-run-test-get-universal \
-  tmp-target-run-test-get-ff \
-  tmp-target-run-test-get-append \
-  tmp-target-run-test-get-pick \
-  tmp-target-run-test-get-new-tag \
-  tmp-target-run-test-get-unnamed
-
-# 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 test/tmp
-       $(pf); cd $$(pwd -P); TMPDIR="$(test_tmp)" \
-         test/ext/test$* 2>&1 | tee -a test/tmp/test-log/$$$$.log
-
-runtests-cmdline: $(test_get_targets) $(subst test/ext/test,tmp-target-run-test,$(cmdline_tests))
+ifeq (yes,$(shell config/bin/python -c "import xdist; print('yes')" 2>/dev/null))
+  # MAKEFLAGS must not be in an immediate := assignment
+  parallel_opt = $(lastword $(filter -j%,$(MAKEFLAGS)))
+  get_parallel_n = $(patsubst -j%,%,$(parallel_opt))
+  maybe_specific_n = $(if $(filter -j%,$(parallel_opt)),-n$(get_parallel_n))
+  xdist_opt = $(if $(filter -j,$(parallel_opt)),-nauto,$(maybe_specific_n))
+else
+  xdist_opt =
+endif
+
+test: all test/tmp
+       ./pytest $(xdist_opt)
 
 stupid:
        PATH=/bin:/usr/bin $(MAKE) test
 
-test: all
-       if test -e test/tmp/test-log; then rm -r test/tmp/test-log; fi
-       mkdir -p test/tmp/test-log
-       ./wvtest watch --no-counts \
-         $(MAKE) runtests 2>test/tmp/test-log/$$$$.log
-       ./wvtest report test/tmp/test-log/*.log
-
 check: test
 
 distcheck: all
-       ./wvtest run test/ext/test-release-archive.sh
+       ./pytest $(xdist_opt) -m release
 
 long-test: export BUP_TEST_LEVEL=11
 long-test: test