Merge pull request #480 from dklempner/runs_per_test

Disable test caching when runs_per_test > 1
pull/500/head
Craig Tiller 10 years ago
commit 6be5e587bd
  1. 7
      tools/run_tests/run_tests.py

@ -180,14 +180,17 @@ forever = args.forever
class TestCache(object): class TestCache(object):
"""Cache for running tests.""" """Cache for running tests."""
def __init__(self): def __init__(self, use_cache_results):
self._last_successful_run = {} self._last_successful_run = {}
self._use_cache_results = use_cache_results
def should_run(self, cmdline, bin_hash): def should_run(self, cmdline, bin_hash):
if cmdline not in self._last_successful_run: if cmdline not in self._last_successful_run:
return True return True
if self._last_successful_run[cmdline] != bin_hash: if self._last_successful_run[cmdline] != bin_hash:
return True return True
if not self._use_cache_results:
return True
return False return False
def finished(self, cmdline, bin_hash): def finished(self, cmdline, bin_hash):
@ -228,7 +231,7 @@ def _build_and_run(check_cancelled, newline_on_success, cache):
return 0 return 0
test_cache = TestCache() test_cache = TestCache(runs_per_test == 1)
test_cache.maybe_load() test_cache.maybe_load()
if forever: if forever:

Loading…
Cancel
Save