Allow running single tests

This makes testing easier, since I'll only see the test I need and not
everything that runs before it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2014-04-13 18:39:56 -04:00
parent 6ee68397fd
commit 30e12bcb68
1 changed files with 10 additions and 3 deletions

View File

@ -3,8 +3,14 @@
import sys
Import("env")
if sys.argv.count("tests") > 0:
env.Append( CCFLAGS = [ "-DCONFIG_TEST" ] )
check_depends = True
for arg in sys.argv:
if arg.find("tests") == 0:
env.Append( CCFLAGS = [ "-DCONFIG_TEST" ] )
if len(arg) > 5:
check_depends = False
break
src = SConscript("src/Sconscript")
@ -17,8 +23,9 @@ prev = None
for test in tests:
t = Command("%s.out" % test, [], "./tests/%s" % test)
if prev:
if prev and (check_depends == True):
Depends(t, prev)
Depends(t, src)
AlwaysBuild(t)
Alias("tests/%s" % test, t)
prev = t