Browse Source

testapp script

Rafał Pitoń 10 years ago
parent
commit
b40344c49c
2 changed files with 29 additions and 1 deletions
  1. 1 1
      runtests.py
  2. 28 0
      testapp

+ 1 - 1
runtests.py

@@ -101,7 +101,7 @@ DATABASES = {
         args = []
         args = []
 
 
     from django.core.management.commands import test
     from django.core.management.commands import test
-    sys.exit(test.Command().execute(*args, verbosity=1))
+    sys.exit(test.Command().execute(*args, verbosity=1, noinput=True))
 
 
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':

+ 28 - 0
testapp

@@ -0,0 +1,28 @@
+#!/bin/bash
+source ~/venvs/misago06/bin/activate
+
+PREFIX=./misago/$1/tests/
+PREFIX_LEN=${#PREFIX}
+
+TESTS=./misago/$1/tests/test_*.py
+for f in $TESTS
+do
+  module=${f:PREFIX_LEN + 5}
+  module=${module:0:${#module} - 3}
+  python runtests.py misago.$1.tests.test_$module 1>/dev/null 2>/tmp/error
+  errors=`tail -n1 /tmp/error`
+
+  if [ "$2" == "md" ] ; then
+    if [ "$errors" == "OK" ] ; then
+      echo "    * [x] $module"
+    else
+      echo "    * [ ] $module: $errors"
+    fi
+  else
+    if [ "$errors" == "OK" ] ; then
+      echo "OK: $module"
+    else
+      echo "ER: $module"
+    fi
+  fi
+done