summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-12-05 19:58:50 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-04-10 18:51:13 +0000
commit2c6801cb37ed5a14435cf2f76ae115eeda0d210e (patch)
treeb935509fa35eb3bfa1d216322409db3d83565063 /mkspecs/features
parent0e204c7dc42627619db9684a9bca031ee545faf7 (diff)
configure: cache test output as well
that way we can create a config.log which is consistent with the end state even if (some) tests are not executed this time around. Change-Id: Ia953ede62d6640aab912559f435ceb1f9ec6d9dc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/configure_base.prf20
-rw-r--r--mkspecs/features/qt_configure.prf24
2 files changed, 39 insertions, 5 deletions
diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf
index e870e2ee10..73e0273f18 100644
--- a/mkspecs/features/configure_base.prf
+++ b/mkspecs/features/configure_base.prf
@@ -23,9 +23,29 @@ QMAKE_MAKE_NAME = $$basename(QMAKE_MAKE)
# Make sure we don't inherit MAKEFLAGS - -i in particular is fatal.
QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE"
+QMAKE_PERSIST_LOG = false
+QMAKE_PERSISTED_LOG =
+
defineTest(qtLog) {
write_file($$QMAKE_CONFIG_LOG, 1, append)
$$QMAKE_CONFIG_VERBOSE: for (l, 1): log("$$l$$escape_expand(\\n)")
+ $$QMAKE_PERSIST_LOG {
+ QMAKE_PERSISTED_LOG += $$1
+ export(QMAKE_PERSISTED_LOG)
+ }
+}
+
+defineTest(qtPersistLog) {
+ QMAKE_PERSIST_LOG = true
+ QMAKE_PERSISTED_LOG =
+ export(QMAKE_PERSIST_LOG)
+ export(QMAKE_PERSISTED_LOG)
+}
+
+defineReplace(qtPersistedLog) {
+ QMAKE_PERSIST_LOG = false
+ export(QMAKE_PERSIST_LOG)
+ return($$QMAKE_PERSISTED_LOG)
}
defineTest(qtRunLoggedCommand) {
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 98fff59ea1..6e29eaa2b7 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -710,13 +710,14 @@ defineTest(qtConfHandleLibrary) {
}
use_args = $$eval($${lpfx}.literal_args)
- qtConfLoadResult($${lpfx}, $$1) {
+ qtConfLoadResult($${lpfx}, $$1, "library") {
$$eval($${lpfx}.result): \
qtConfExportLibrary($$1)
return()
}
qtLogTestIntro($${lpfx}, "looking for library $${1}")
+ qtPersistLog()
result = false
for (s, $${lpfx}.sources._KEYS_) {
@@ -768,6 +769,9 @@ defineTest(qtConfHandleLibrary) {
break()
}
+ $${lpfx}.msgs = $$qtPersistedLog()
+ export($${lpfx}.msgs)
+
qtLogTestResult($${lpfx}, $$result)
$${lpfx}.result = $$result
@@ -1023,7 +1027,7 @@ defineTest(qtLogTestIntro) {
label = $$eval($${1}.label)
isEmpty(label): return()
- log("Checking for $${label}... ")
+ isEmpty(3): log("Checking for $${label}... ")
$$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)")
write_file($$QMAKE_CONFIG_LOG, 2, append)
}
@@ -1043,14 +1047,14 @@ defineTest(qtLogTestResult) {
msg = "test $$1 FAILED"
}
$$QMAKE_CONFIG_VERBOSE: log_msg = $$msg
- logn("$$log_msg")
+ isEmpty(3): logn("$$log_msg")
write_file($$QMAKE_CONFIG_LOG, msg, append)
}
defineTest(qtConfSaveResult) {
equals($${1}.cache, -): \
return()
- keys = result $$eval($${1}.cache)
+ keys = result msgs $$eval($${1}.cache)
cont = "cache.$${2}._KEYS_ = $$keys"
cache.$${2}._KEYS_ = $$keys
export(cache.$${2}._KEYS_)
@@ -1073,6 +1077,12 @@ defineTest(qtConfLoadResult) {
$${1}.$${k} = $$eval(cache.$${2}.$${k})
export($${1}.$${k})
}
+ # we could print the cached result, but that's basically just noise -
+ # the explicitly generated summary is supposed to contain all relevant
+ # information.
+ qtLogTestIntro($$1, "loaded result for $$3 $$1", false)
+ qtLog($$eval($${1}.msgs))
+ qtLogTestResult($$1, $$eval($${1}.result), false)
return(true)
}
@@ -1153,14 +1163,18 @@ defineTest(qtRunSingleTest) {
# note: we do this only after resolving the dependencies and the
# preparation (which may resolve libraries), so that caching does
# not alter the execution order (and thus the output).
- qtConfLoadResult($${tpfx}, $$1): \
+ qtConfLoadResult($${tpfx}, $$1, "config test"): \
return()
qtLogTestIntro($${tpfx}, "executing config test $${1}")
+ qtPersistLog()
result = false
$${call}($${tpfx}): result = true
+ $${tpfx}.msgs = $$qtPersistedLog()
+ export($${tpfx}.msgs)
+
qtLogTestResult($${tpfx}, $$result)
$${tpfx}.result = $$result