]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Now, tester can be run from any test subdirectory to run tests only in that directory.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 15 Mar 2007 07:25:00 +0000 (07:25 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 15 Mar 2007 07:25:00 +0000 (07:25 +0000)
darcs-hash:20070315072516-f2ef6-7f33869128524319a9e7390f8e7724d1008506c0.gz

tests/Makefile
tests/tester.py

index 98e21dae49323fe100a26c70aad0faf3da1be42d..595320ffd83f6a2ebc6f24c416ee0d5ceb50dbb9 100644 (file)
@@ -1,4 +1,4 @@
 
 all:
-       find -name runtest -print0|xargs -0 chmod +x
+       find -name 'runtest*' -print0|xargs -0 chmod +x
        python tester.py
index 5ab454e70f51338ca0017827e8417b8f66e5fdab..2cdace974c620abefa6bb2d1a8504990f0c36fac 100755 (executable)
@@ -10,7 +10,12 @@ import time
 from xml.sax.saxutils import escape
 import fnmatch
 
-sys.path.append("..")
+invokeDir = os.getcwd();
+testsRoot = os.path.dirname(os.path.abspath(__file__))
+if not os.path.exists(os.path.join(testsRoot, "tester.py")): raise "Can't find tests root directory!"
+os.environ['OMK_TESTSROOT'] = testsRoot
+
+sys.path.append(os.path.join(testsRoot, ".."))
 import rulesdef
 
 class Results(dict):
@@ -248,13 +253,9 @@ class TestCase:
         print ret,
 
 
-testsRoot = os.path.dirname(os.path.abspath(__file__))
-if not os.path.exists(os.path.join(testsRoot, "tester.py")): raise "Can't find tests root directory!"
-os.environ['OMK_TESTSROOT'] = testsRoot
-
 results = Results()
 
-for dirpath, dirnames, filenames in os.walk(testsRoot):
+for dirpath, dirnames, filenames in os.walk(invokeDir):
     executables = fnmatch.filter(filenames, "runtest*")
     if not executables: continue
     for exe in executables:
@@ -263,7 +264,7 @@ for dirpath, dirnames, filenames in os.walk(testsRoot):
         t.run()
         results[t.name] = t.results
 
-os.chdir(testsRoot)
+os.chdir(invokeDir)
 results.save()
 
 # Local Variables: