--- /dev/null
+Description of Testcases for OMK
+================================
+
+Each test resides in a separate directory. The directories can be
+nested. There is no difference between the tests in diffrent levels of
+directory structure.
+
+Structure of a Testcase
+-----------------------
+
+A directory contain the testcase if it contains at least one of these
+files: Makefile.test, run_test.
+
+Definition of a Testcase:
+
+* Makefile.test: testcase commands in the form of makefile. The test is
+ run by "make -f Makefile.test". If the exit status is zero, the
+ testcase is considered as passed, otherwise as failed.
+
+* run_test: executable file that runs the test(s). The exit status has
+ the same meaning as in the case of Makefile.test.
+
+* rules: Specifies the rules this testcase applies to. The syntax of
+ this files is describes in section Rules description.
+
+Output of testcase:
+
+Besides exit status, the testcases can produce the folowing output.
+
+* FIXME: chybove hlaseni - soubor error nebo stderr?
+
+Rules Description
+-----------------
+
+The rules file contains one or more lines. Each line represents a set
+of zero or more rules. The set of rules to be applied to this testcase
+is union of these sets.
+
+Each line can contain:
+
+* <rule name> - This selects rules of this name
+
+* all: - this selects all rules
+
+* snip:<snippet name> - this selects all the rules, which are composed
+ of the given snippet.
--- /dev/null
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+ @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
+print_vars:
+ echo $(COMPILED_DIR)
\ No newline at end of file
--- /dev/null
+#!/usr/bin/env python
+
+import os.path
+import sys
+import re
+
+sys.path.append("..")
+import rulesdef
+
+class TestCase:
+ def __init__(self, directory):
+ self.directory = directory
+ self._whichRules()
+
+ def _whichRules(self):
+ self.rules = []
+ try:
+ f = open(os.path.join(self.directory, 'rules'))
+ except IOError:
+ self.rules = rulesdef.rules.keys()
+ return
+ for line in f:
+ colonDef = re.search('([^:]*):(.*)', line)
+ if colonDef:
+ print colonDef.groups()
+ #todo s[nip[pet]]:...
+ elif re.search('^all', line):
+ self.rules = rulesdef.rules.keys()
+ else:
+ #todo rule name
+ print "Neco jineho: ", line
+
+
+ def run(self):
+ print "Testing rules: ",
+ for rules in self.rules:
+ print rules,
+ self._copyRules(rules)
+ self._doRun()
+ print
+
+ def _copyRules(self, rules):
+ pass
+
+ def _doRun(self):
+ pass
+
+x = TestCase("programs")
+x.run()
+x = TestCase("none")
+x.run()
+x = TestCase("colon")
+x.run()