-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest_versions.sh
executable file
·56 lines (49 loc) · 975 Bytes
/
test_versions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Script for testing on different python versions
function restore {
if [ -f test.py.bak ]
then
mv test.py.bak test.py
fi
}
function check_success {
if [ $? -ne 0 ]
then
restore
exit 1
fi
}
rm -rf build
pandoc --from=markdown --to=rst --output=README.txt README.md
if [ "$1" == "notest" ]
then
notest=1
else
notest=0
fi
for version in 2.5 2.6 2.7 3.1 3.2 3.3
do
echo -e "\n\nPYTHON $version\n==========\n"
CFLAGS="-UNDEBUG" python$version setup.py build
check_success
echo ""
loc=$version
if [ "$version" == "2.7-dbg" ]
then
loc="2.7-pydebug"
fi
if [ "${version%.*}" == "3" ]
then
if [ ! -f test.py.bak ]
then
2to3 --no-diffs -w test.py
fi
fi
if [ $notest -eq 0 ]
then
PYTHONPATH="build/lib.linux-x86_64-$loc/" python$version -c "import lazysorted; print(lazysorted);"
PYTHONPATH="build/lib.linux-x86_64-$loc/" python$version test.py
check_success
fi
done
restore