aboutsummaryrefslogtreecommitdiffstats
path: root/qbs
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2012-09-05 11:01:43 +0200
committerJoerg Bornemann <joerg.bornemann@nokia.com>2012-09-13 10:46:51 +0200
commit40d919eed8897f0806879274ee298eaed65514b6 (patch)
tree165831238e897d8ac3d11be1b54ddbe11f723e8c /qbs
parent405217c111d22ea2b2913fd08b4f870e4e43aa38 (diff)
Support built-in testing infrastructure with qbs build.
I.e. define WITH_TESTS for debug builds or if the respective environment variable is set. Change-Id: I2764ece50d0783e8cb030b1695e6f59cf6063248 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'qbs')
-rw-r--r--qbs/defaults.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/qbs/defaults.js b/qbs/defaults.js
new file mode 100644
index 0000000000..1b835f6928
--- /dev/null
+++ b/qbs/defaults.js
@@ -0,0 +1,12 @@
+function testsEnabled(qbs)
+{
+ return qbs.getenv("TEST") || qbs.buildVariant === "debug";
+}
+
+function defines(qbs)
+{
+ var list = [ 'IDE_LIBRARY_BASENAME="lib"' ]
+ if (testsEnabled(qbs))
+ list.push("WITH_TESTS")
+ return list
+}