Permalink
Browse files

Tests: basic help and coverage.py support

run_all_tests.sh now supports --help and --with-coverage
  • Loading branch information...
1 parent 96f1624 commit c000f8ac2452ac385e58ece1d2b0e8e8ea4cff51 @acdha acdha committed Nov 6, 2012
Showing with 26 additions and 10 deletions.
  1. +26 −10 tests/run_all_tests.sh
View
@@ -1,36 +1,52 @@
-#!/bin/sh
+#!/bin/bash
+
+if [ "$1" == "--help" ]; then
+ echo "Runs the test suite for all backends"
+ echo
+ echo "See docs/running_tests.rst for instructions on installing test"
+ echo "search engine instances"
+ echo
+ echo "Use $0 --with-coverage to execute tests using coverage.py"
+ echo
+ exit 0
+elif [ "$1" == "--with-coverage" ]; then
+ TEST_RUNNER="coverage run --source=$(realpath "$(dirname "$0")/../haystack") -- `which django-admin.py`"
+else
+ TEST_RUNNER=django-admin.py
+fi
+
echo "** CORE **"
-django-admin.py test core --settings=settings
+$TEST_RUNNER test core --settings=settings
echo ""
echo "** DISCOVERY **"
-django-admin.py test discovery --settings=discovery_settings
+$TEST_RUNNER test discovery --settings=discovery_settings
echo ""
echo "** OVERRIDES **"
-django-admin.py test overrides --settings=overrides_settings
+$TEST_RUNNER test overrides --settings=overrides_settings
echo ""
echo "** SIMPLE **"
-django-admin.py test simple_tests --settings=simple_settings
+$TEST_RUNNER test simple_tests --settings=simple_settings
echo ""
echo "** SOLR **"
-django-admin.py test solr_tests --settings=solr_settings
+$TEST_RUNNER test solr_tests --settings=solr_settings
echo ""
echo "** Elasticsearch **"
-django-admin.py test elasticsearch_tests --settings=elasticsearch_settings
+$TEST_RUNNER test elasticsearch_tests --settings=elasticsearch_settings
echo ""
echo "** WHOOSH **"
-django-admin.py test whoosh_tests --settings=whoosh_settings
+$TEST_RUNNER test whoosh_tests --settings=whoosh_settings
echo ""
echo "** MULTIPLE INDEX **"
-django-admin.py test multipleindex --settings=multipleindex_settings
+$TEST_RUNNER test multipleindex --settings=multipleindex_settings
echo ""
echo "** SPATIAL **"
-django-admin.py test spatial --settings=spatial_settings
+$TEST_RUNNER test spatial --settings=spatial_settings
echo ""

0 comments on commit c000f8a

Please sign in to comment.