~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to test/test_framework/test.py

  • Committer: stevenbird
  • Date: 2008-01-24 04:59:27 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:284
recovered tests.py from svn revision 280 and put in test.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
import sys
 
3
sys.path.append('../../www/apps/tutorial/test/')
 
4
 
 
5
from parse_tute import *
 
6
 
 
7
def print_results((name, results)):
 
8
    """ Print the output of a testsuite nicely """
 
9
    print name
 
10
    for (case_name, test_results) in results:
 
11
        print "Case: " + case_name
 
12
        for test_result in test_results:
 
13
            print "  " + test_result
 
14
    print 
 
15
 
 
16
for i in range(1, len(sys.argv)):
 
17
    basename = sys.argv[i]
 
18
    xmlfile = basename + '_text.xml'
 
19
    pyfile = basename + '.py'
 
20
 
 
21
    print "Testing:", basename
 
22
    problem_suite = parse_tutorial_file(xmlfile)
 
23
    print_results(problem_suite.run_tests(pyfile))