Bläddra i källkod

Env var PYTHON to allow local test with py3k

Matthew Wang 11 år sedan
förälder
incheckning
b1d1c42fe2
2 ändrade filer med 8 tillägg och 2 borttagningar
  1. 4
    1
      Makefile
  2. 4
    1
      tests/regression.sh

+ 4
- 1
Makefile Visa fil

@@ -2,7 +2,7 @@
2 2
 
3 3
 TESTPYPI = http://testpypi.python.org/pypi
4 4
 
5
-.PHONY: dogfood test clean build dist-test dist
5
+.PHONY: dogfood test test3 clean build dist-test dist
6 6
 
7 7
 dogfood:
8 8
 	./cdiff.py
@@ -11,6 +11,9 @@ dogfood:
11 11
 test:
12 12
 	tests/regression.sh
13 13
 
14
+test3:
15
+	PYTHON=python3 tests/regression.sh
16
+
14 17
 clean:
15 18
 	rm -f MANIFEST
16 19
 	rm -rf build/ cdiff.egg-info/ dist/ __pycache__/

+ 4
- 1
tests/regression.sh Visa fil

@@ -5,6 +5,9 @@ set -o errexit
5 5
 SELF_DIR=$(cd $(dirname $0) && pwd) || exit 1
6 6
 CDIFF=$SELF_DIR/../cdiff
7 7
 
8
+# To test with py3k: PYTHON=python3 make test
9
+PYTHON=${PYTHON:-python}
10
+
8 11
 function pass()
9 12
 {
10 13
     if [[ -t 1 ]]; then
@@ -30,7 +33,7 @@ function cmpOutput()
30 33
     local cdiff_opt=${3:-""}
31 34
 
32 35
     echo -n "Test option '$cdiff_opt' with input '$input' ... "
33
-    if $CDIFF $cdiff_opt $input 2>/dev/null \
36
+    if $PYTHON $CDIFF $cdiff_opt $input 2>/dev/null \
34 37
             | diff -ubq $expected_out - >& /dev/null; then
35 38
         pass
36 39
         return 0