From 10f5278c9836cf736db6be052a3e0498767e335a Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 31 May 2015 17:16:30 +0100 Subject: [PATCH] allow specification of test directory and source extension --- run_tests.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/run_tests.py b/run_tests.py index 44ed109..ee1c30a 100644 --- a/run_tests.py +++ b/run_tests.py @@ -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)