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
parentda72c368654cb3e9d8c223cef1bece9056a29c4e (diff)
downloadswift-contrib-276d7f82ba42cdbc65ec5c9f35873a265a69bd73.zip
swift-contrib-276d7f82ba42cdbc65ec5c9f35873a265a69bd73.tar.bz2
Added check_output SCons flag to generate an XML report.
-rw-r--r--.gitignore1
-rw-r--r--BuildTools/SCons/SConstruct1
-rw-r--r--BuildTools/SCons/Tools/Test.py12
-rw-r--r--QA/Checker/checker.cpp2
-rw-r--r--QA/UnitTest/SConscript2
-rw-r--r--Swiften/QA/NetworkTest/SConscript2
-rw-r--r--Swiften/QA/ReconnectTest/SConscript2
-rw-r--r--Swiften/QA/SConscript6
-rw-r--r--Swiften/QA/StorageTest/SConscript2
9 files changed, 19 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index fc04978..e9b5482 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,4 @@ config.log
Swiften/Examples/TuneBot/TuneBot
Swift/QtUI/swift
Swift/QtUI/DefaultTheme.qrc
+checker-report.xml
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")
diff --git a/QA/Checker/checker.cpp b/QA/Checker/checker.cpp
index 9a9082b..1870b5d 100644
--- a/QA/Checker/checker.cpp
+++ b/QA/Checker/checker.cpp
@@ -67,7 +67,7 @@ int main(int argc, char* argv[]) {
// Output the results
if (outputXML) {
- CppUnit::XmlOutputter outputter(&result, std::cerr);
+ CppUnit::XmlOutputter outputter(&result, std::cout);
outputter.write();
}
else {
diff --git a/QA/UnitTest/SConscript b/QA/UnitTest/SConscript
index b5f382c..805ac39 100644
--- a/QA/UnitTest/SConscript
+++ b/QA/UnitTest/SConscript
@@ -29,4 +29,4 @@ if env["TEST"] :
for i in ["HOME", "USERPROFILE", "APPDATA"]:
if os.environ.get(i, "") :
myenv["ENV"][i] = os.environ[i]
- myenv.Test(checker)
+ myenv.Test(checker, is_checker = True)
diff --git a/Swiften/QA/NetworkTest/SConscript b/Swiften/QA/NetworkTest/SConscript
index 0e821c0..33c4b6d 100644
--- a/Swiften/QA/NetworkTest/SConscript
+++ b/Swiften/QA/NetworkTest/SConscript
@@ -16,4 +16,4 @@ if env["TEST"] :
"BoostConnectionTest.cpp",
"DomainNameResolverTest.cpp",
])
- myenv.Test(tester, "system")
+ myenv.Test(tester, "system", is_checker = True)
diff --git a/Swiften/QA/ReconnectTest/SConscript b/Swiften/QA/ReconnectTest/SConscript
index 2eff8b4..6db6a6f 100644
--- a/Swiften/QA/ReconnectTest/SConscript
+++ b/Swiften/QA/ReconnectTest/SConscript
@@ -22,4 +22,4 @@ if env["TEST"] :
myenv["ENV"][i] = os.environ[i]
tester = myenv.Program("ReconnectTest", ["ReconnectTest.cpp"])
- myenv.Test(tester, "system")
+ myenv.Test(tester, "system", is_checker = True)
diff --git a/Swiften/QA/SConscript b/Swiften/QA/SConscript
index e9c1546..4a049e4 100644
--- a/Swiften/QA/SConscript
+++ b/Swiften/QA/SConscript
@@ -1,7 +1,7 @@
SConscript(dirs = [
"NetworkTest",
- "ReconnectTest",
- "ClientTest",
- "DNSSDTest",
+# "ReconnectTest",
+# "ClientTest",
+# "DNSSDTest",
"StorageTest",
])
diff --git a/Swiften/QA/StorageTest/SConscript b/Swiften/QA/StorageTest/SConscript
index c35d5b3..bd77793 100644
--- a/Swiften/QA/StorageTest/SConscript
+++ b/Swiften/QA/StorageTest/SConscript
@@ -15,4 +15,4 @@ if env["TEST"] :
tester = myenv.Program("StorageTest", [
"VCardFileStorageTest.cpp",
])
- myenv.Test(tester, "system")
+ myenv.Test(tester, "system", is_checker = True)