summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-09-02 20:14:09 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-09-02 21:22:32 (GMT)
commit276d7f82ba42cdbc65ec5c9f35873a265a69bd73 (patch)
tree9a6b5ee0808a33d7b257f255d23ee3af851fec08 /BuildTools
parentda72c368654cb3e9d8c223cef1bece9056a29c4e (diff)
downloadswift-contrib-276d7f82ba42cdbc65ec5c9f35873a265a69bd73.zip
swift-contrib-276d7f82ba42cdbc65ec5c9f35873a265a69bd73.tar.bz2
Added check_output SCons flag to generate an XML report.
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/SCons/SConstruct1
-rw-r--r--BuildTools/SCons/Tools/Test.py12
2 files changed, 10 insertions, 3 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 5a64f2d..db9c039 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -161,6 +161,7 @@ if env["PLATFORM"] == "darwin" and not env["target"] in ["iphone-device", "iphon
env["TEST_TYPE"] = env["test"]
if "check" in ARGUMENTS :
env["TEST_TYPE"] = "unit"
+env["checker_report"] = ARGUMENTS.get("checker_report", False)
env["TEST"] = (env["TEST_TYPE"] != "none") or env.GetOption("clean")
if env.get("valgrind", 0) :
env["TEST_RUNNER"] = "valgrind --suppressions=QA/valgrind.supp -q --leak-check=full --track-origins=yes "
diff --git a/BuildTools/SCons/Tools/Test.py b/BuildTools/SCons/Tools/Test.py
index aaed222..978e0d2 100644
--- a/BuildTools/SCons/Tools/Test.py
+++ b/BuildTools/SCons/Tools/Test.py
@@ -1,11 +1,17 @@
-import SCons.Util
+import SCons.Util, os
def generate(env) :
- def registerTest(env, target, type = "unit") :
+ def registerTest(env, target, type = "unit", is_checker = False) :
if env["TEST_TYPE"] == "all" or env["TEST_TYPE"] == type :
cmd = target[0].abspath if SCons.Util.is_List(target) else target.abspath
+ params = ""
+
+ # Special support for unittest checker
+ if is_checker and env.get("checker_report", False) :
+ params = " --xml > " + os.path.join(target[0].dir.path, "checker-report.xml")
+
env.Command("**dummy**", target,
- SCons.Action.Action(env.get("TEST_RUNNER", "") + cmd, cmdstr = "$TESTCOMSTR"))
+ SCons.Action.Action(env.get("TEST_RUNNER", "") + cmd + " " + params, cmdstr = "$TESTCOMSTR"))
env.AddMethod(registerTest, "Test")