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
 
2
 
3
 TESTPYPI = http://testpypi.python.org/pypi
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
 dogfood:
7
 dogfood:
8
 	./cdiff.py
8
 	./cdiff.py
11
 test:
11
 test:
12
 	tests/regression.sh
12
 	tests/regression.sh
13
 
13
 
14
+test3:
15
+	PYTHON=python3 tests/regression.sh
16
+
14
 clean:
17
 clean:
15
 	rm -f MANIFEST
18
 	rm -f MANIFEST
16
 	rm -rf build/ cdiff.egg-info/ dist/ __pycache__/
19
 	rm -rf build/ cdiff.egg-info/ dist/ __pycache__/

+ 4
- 1
tests/regression.sh Visa fil

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