allow specification of test directory and source extension

master
Daniel Kolesa 2015-05-31 17:16:30 +01:00
parent 0954b256ee
commit 10f5278c98
1 changed files with 6 additions and 4 deletions

View File

@ -13,6 +13,8 @@ CXXFLAGS = [
"-I."
]
COLORS = (osname != "nt")
TESTDIR = "tests"
SRCEXT = ".cpp"
# don't modify past these lines
@ -39,14 +41,14 @@ def print_result(modname, fmsg = None):
print modname + "...\t%(green)s%(bold)s(success)%(end)s" % colors
nsuccess += 1
for fname in listdir("tests"):
for fname in listdir(TESTDIR):
(modname, modext) = splitext(fname)
if modext != ".cpp":
if modext != SRCEXT:
continue
srcpath = joinp("tests", fname)
exepath = joinp("tests", modname)
srcpath = joinp(TESTDIR, fname)
exepath = joinp(TESTDIR, modname)
pc = sp.Popen([ COMPILER, srcpath, "-o", exepath ] + CXXFLAGS,
stdout = sp.PIPE, stderr = sp.STDOUT)