]> arthur.barton.de Git - bup.git/blobdiff - Makefile
DESIGN: describe plan to handle Python 3's insistence on strings
[bup.git] / Makefile
index 84c94f4b387d31d07346a372424abd634cbe37fa..a7c413dbf0355f2eaa980ae1f86caad5a90f3a9d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -140,22 +140,40 @@ lib/bup/_checkout.py:
 t/tmp:
        mkdir t/tmp
 
+runtests: runtests-python runtests-cmdline
+
+python_tests := \
+  lib/bup/t/thashsplit.py \
+  lib/bup/t/toptions.py \
+  lib/bup/t/tshquote.py \
+  lib/bup/t/tvint.py \
+  lib/bup/t/txstat.py
+
 ifeq "2" "$(bup_python_majver)"
-  runtests: runtests-python runtests-cmdline
-else
-  runtests: runtests-cmdline
+  python_tests += \
+    lib/bup/t/tbloom.py \
+    lib/bup/t/tclient.py \
+    lib/bup/t/tgit.py \
+    lib/bup/t/thelpers.py \
+    lib/bup/t/tindex.py \
+    lib/bup/t/tmetadata.py \
+    lib/bup/t/tresolve.py \
+    lib/bup/t/tvfs.py
 endif
 
 # 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
+       mkdir -p t/tmp/test-log
        $(pf); cd $$(pwd -P); TMPDIR="$(test_tmp)" \
-         "$(bup_python)" wvtest.py t/t*.py lib/*/t/t*.py 2>&1 \
+         "$(bup_python)" wvtest.py  $(python_tests) 2>&1 \
            | tee -a t/tmp/test-log/$$$$.log
 
+cmdline_tests :=
+
 ifeq "2" "$(bup_python_majver)"
-  cmdline_tests := \
+  cmdline_tests += \
     t/test-ftp \
     t/test-save-restore \
     t/test-packsizelimit \
@@ -193,16 +211,16 @@ ifeq "2" "$(bup_python_majver)"
     t/test-import-rdiff-backup.sh \
     t/test-xdev.sh \
     t/test.sh
-else
-  cmdline_tests :=
 endif
 
 tmp-target-run-test-get-%: all t/tmp
        $(pf); cd $$(pwd -P); TMPDIR="$(test_tmp)" \
          t/test-get $* 2>&1 | tee -a t/tmp/test-log/$$$$.log
 
+test_get_targets :=
+
 ifeq "2" "$(bup_python_majver)"
-  test_get_targets := \
+  test_get_targets += \
     tmp-target-run-test-get-replace \
     tmp-target-run-test-get-universal \
     tmp-target-run-test-get-ff \
@@ -210,8 +228,6 @@ ifeq "2" "$(bup_python_majver)"
     tmp-target-run-test-get-pick \
     tmp-target-run-test-get-new-tag \
     tmp-target-run-test-get-unnamed
-else
-  test_get_targets :=
 endif
 
 # For parallel runs.
@@ -251,6 +267,13 @@ long-test: test
 long-check: export BUP_TEST_LEVEL=11
 long-check: check
 
+.PHONY: check-both
+check-both:
+       $(MAKE) clean \
+         && PYTHON=python3 BUP_ALLOW_UNEXPECTED_PYTHON_VERSION=true $(MAKE) check
+       $(MAKE) clean \
+         && PYTHON=python2 $(MAKE) check
+
 cmd/bup-%: cmd/%-cmd.py
        rm -f $@
        ln -s $*-cmd.py $@