forked from ifanrx/django-dajaxice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_runner.sh
More file actions
executable file
·31 lines (26 loc) · 810 Bytes
/
test_runner.sh
File metadata and controls
executable file
·31 lines (26 loc) · 810 Bytes
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
#!/usr/bin/env bash
function is_lower_ver {
ver=`echo -ne "$1\n$2" |sort -Vr |head -n1`
if [ "$2" == "$1" ]; then
return 1
elif [ "$2" == "$ver" ]; then
return 1
else
return 0
fi
}
django_ver=`python -c "import django; print(django.get_version())"`
# use app-test-runner for older versions of django
if is_lower_ver "1.7" "$django_ver"; then
pip install https://github.com/jorgebastida/django-app-test-runner/zipball/master
if echo $django_ver | grep ^1.6; then
# for some reasons, django 1.6 requires this
tests=dajaxice.tests
else
tests=dajaxice
fi
app-test-runner dajaxice $tests
else
# for django > 1.6, use the new test runner
python dajaxice/runtests.py
fi