Files
zulip/tools/test-management
Tim Abbott 9d75fd33d9 Add new test for management commands running with --help.
This test caught a few bugs where refactoring had made management
commands fail (and would have caught a few more recent ones).

Ideally we'd replace this with a more advanced test that actually
tests that the management command do something useful, but it's a
start.
2015-11-11 21:34:39 -08:00

19 lines
456 B
Bash
Executable File

#!/bin/bash
set -e
echo "Testing management commands start!"
failed=0
for i in `ls */management/commands/ | grep .py$ | grep -v __init__ | sed 's/[.]py$//'`; do
if ! $(./manage.py $i --help >/dev/null); then
failed=$(expr $failed + 1)
echo "ERROR: \`./manage.py $i --help\` crashes!";
fi
done
if [ $failed -gt 0 ]; then
echo
echo "$failed management commands don't start!"
exit 1
fi
echo "All management commands start!"