Skip to content

Commit

Permalink
configure: support discarding selected test results with -recheck
Browse files Browse the repository at this point in the history
especially during debugging, it is often necessary to re-run only one
(or a few) tests, where -recheck-all would be wasteful.

Task-number: QTBUG-64059
Change-Id: I9410894dec4289ff832d7f75e04f9b60fe76c57c
Reviewed-by: Lars Knoll <[email protected]>
  • Loading branch information
ossilator committed Dec 14, 2017
1 parent af70d4e commit fd3423b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 3 additions & 1 deletion config_help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ Configure meta:
-redo ................ Re-configure with previously used options.
Additional options may be passed, but will not be
saved for later use by -redo.
-recheck ............. Discard cached negative configure test results.
-recheck [test,...] .. Discard cached negative configure test results.
Use this after installing missing dependencies.
Alternatively, if tests are specified, only their
results are discarded.
-recheck-all ......... Discard all cached configure test results.

-feature-<feature> ... Enable <feature>
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/data/configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

"continue": "void",

"recheck": { "type": "void", "name": "cache_use", "value": "positive" },
"recheck": { "type": "optionalString", "name": "cache_recheck" },
"recheck-all": { "type": "void", "name": "cache_use", "value": "none" },

"redo": { "type": "redo" },
Expand Down
16 changes: 15 additions & 1 deletion mkspecs/features/qt_configure.prf
Original file line number Diff line number Diff line change
Expand Up @@ -2041,14 +2041,28 @@ qtConfCheckErrors()

QMAKE_CONFIG_CACHE = $$OUT_PWD/config.cache
QMAKE_CONFIG_CACHE_USE = $$eval(config.input.cache_use)
cache_recheck = $$eval(config.input.cache_recheck)
equals(cache_recheck, yes) {
QMAKE_CONFIG_CACHE_USE = positive
cache_recheck =
}
isEmpty(QMAKE_CONFIG_CACHE_USE): \
QMAKE_CONFIG_CACHE_USE = all
!equals(QMAKE_CONFIG_CACHE_USE, none) {
include($$QMAKE_CONFIG_CACHE, , true)
# this crudely determines when to discard the cache. this also catches the case
# of no cache being there in the first place.
!equals(cache.platform, $$[QMAKE_SPEC])|!equals(cache.xplatform, $$[QMAKE_XSPEC]): \
!equals(cache.platform, $$[QMAKE_SPEC])|!equals(cache.xplatform, $$[QMAKE_XSPEC]) {
QMAKE_CONFIG_CACHE_USE = none
} else: !isEmpty(cache_recheck) {
for (cr, $$list($$split(cache_recheck, ","))) {
!isEmpty(cache.$${cr}._KEYS_) {
cache.$${cr}._KEYS_ =
} else {
qtConfAddWarning("Attempting to discard non-cached result '$$cr'.")
}
}
}
}
equals(QMAKE_CONFIG_CACHE_USE, none) {
cont = \
Expand Down

0 comments on commit fd3423b

Please sign in to comment.