runtests.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. export PYTHONPATH=.
  3. django_test() {
  4. TEST="$1"
  5. $TEST 2>&1 | grep "Ran $2 test" > /dev/null
  6. if [ $? -gt 0 ]
  7. then
  8. echo FAIL: $3
  9. $TEST
  10. exit 1;
  11. else
  12. echo PASS: $3
  13. fi
  14. # Check that we're hijacking the help correctly.
  15. $TEST --help 2>&1 | grep 'NOSE_DETAILED_ERRORS' > /dev/null
  16. if [ $? -gt 0 ]
  17. then
  18. echo FAIL: $3 '(--help)'
  19. exit 1;
  20. else
  21. echo PASS: $3 '(--help)'
  22. fi
  23. }
  24. django_test 'django-admin.py test --settings=testapp.settings' '2' 'normal settings'
  25. django_test 'django-admin.py test --settings=testapp.settings_with_south' '2' 'with south in installed apps'
  26. django_test 'django-admin.py test --settings=testapp.settings_old_style' '2' 'django_nose.run_tests format'
  27. django_test 'testapp/runtests.py testapp.test_only_this' '1' 'via run_tests API'
  28. django_test 'django-admin.py test --settings=testapp.settings_with_plugins testapp/plugin_t' '1' 'with plugins'
  29. django_test 'django-admin.py test --settings=testapp.settings unittests' '4' 'unittests'