aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/.gitignore1
-rwxr-xr-xbin/runtests24
-rwxr-xr-xbin/trigger_tdaemon_run7
3 files changed, 32 insertions, 0 deletions
diff --git a/bin/.gitignore b/bin/.gitignore
new file mode 100644
index 0000000..02d1091
--- /dev/null
+++ b/bin/.gitignore
@@ -0,0 +1 @@
+.daemon_run_dummy
diff --git a/bin/runtests b/bin/runtests
new file mode 100755
index 0000000..4893ba0
--- /dev/null
+++ b/bin/runtests
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+while getopts sa:dc arg; do
+ case ${arg} in
+ s) SETTINGS="--settings=okupy.tests.settings" ;;
+ a) APPS=${OPTARG} ;;
+ d) TDAEMON="tdaemon -t django" ;;
+ c) COVERAGE="coverage" ;;
+ esac
+done
+
+[[ -z ${APPS} ]] && APPS="tests"
+
+if [[ -n ${TDAEMON} ]]; then
+ [[ -n ${COVERAGE} ]] && COVERAGE="-c"
+ ${TDAEMON} ${COVERAGE} --custom-args="${SETTINGS} ${APPS}"
+elif [[ -n ${COVERAGE} ]]; then
+ ${COVERAGE} run manage.py test ${SETTINGS} ${APPS}
+ ${COVERAGE} report -m
+else
+ COMMAND="python manage.py test ${SETTINGS} ${APPS}"
+ echo "Executing: $COMMAND"
+ $COMMAND
+fi
diff --git a/bin/trigger_tdaemon_run b/bin/trigger_tdaemon_run
new file mode 100755
index 0000000..a04d9b6
--- /dev/null
+++ b/bin/trigger_tdaemon_run
@@ -0,0 +1,7 @@
+#!/bin/bash
+DUMMY="bin/.daemon_run_dummy"
+if [[ -f $DUMMY ]]; then
+ rm $DUMMY
+else
+ touch $DUMMY
+fi