2011-11-14 11:10:59 +00:00
|
|
|
#!/bin/sh
|
|
|
|
check_redis_running() {
|
|
|
|
redis-cli echo "just checking" > /dev/null
|
|
|
|
return $?
|
|
|
|
}
|
|
|
|
|
2012-02-05 08:14:40 +00:00
|
|
|
if which -s rg; then
|
|
|
|
safe_rg=rg
|
|
|
|
else
|
|
|
|
# Fall back for systems that don't have rg installed
|
|
|
|
safe_rg=cat
|
|
|
|
fi
|
|
|
|
|
2011-11-14 11:10:59 +00:00
|
|
|
if check_redis_running; then
|
2012-02-05 08:14:40 +00:00
|
|
|
/usr/bin/env python -m unittest discover -v -s tests $@ 2>&1 | egrep -v '^test_' | $safe_rg
|
2011-11-14 11:10:59 +00:00
|
|
|
else
|
|
|
|
echo "Redis not running." >&2
|
2012-01-25 14:24:48 +00:00
|
|
|
exit 2
|
2011-11-14 11:10:59 +00:00
|
|
|
fi
|