]> rtime.felk.cvut.cz Git - omk/sssa.git/blob - tests/runtests.py
Added tests for vxWorks.
[omk/sssa.git] / tests / runtests.py
1 #!/usr/bin/env python
2
3 import os.path
4 import sys
5 import re
6
7 sys.path.append("..")
8 import rulesdef
9
10 class TestCase:
11     def __init__(self, directory):
12         self.directory = directory
13         self._whichRules()
14
15     def _whichRules(self):
16         self.rules = []
17         try:
18             f = open(os.path.join(self.directory, 'rules'))
19         except IOError:
20             self.rules = rulesdef.rules.keys()
21             return
22         for line in f:
23             colonDef = re.search('([^:]*):(.*)', line)
24             if colonDef:
25                 print colonDef.groups()
26                 #todo s[nip[pet]]:...
27             elif re.search('^all', line):
28                 self.rules = rulesdef.rules.keys()
29             else:
30                 #todo rule name
31                 print "Neco jineho: ", line
32         
33
34     def run(self):
35         print "Testing rules: ",
36         for rules in self.rules:
37             print rules,
38             self._copyRules(rules)
39             self._doRun()
40         print
41
42     def _copyRules(self, rules):
43         pass
44     
45     def _doRun(self):
46         pass
47
48 x = TestCase("programs")
49 x.run()
50 x = TestCase("none")
51 x.run()
52 x = TestCase("colon")
53 x.run()