diff options
author | 2015-01-15 23:16:51 -0800 | |
---|---|---|
committer | 2015-01-15 23:16:51 -0800 | |
commit | a6b4186e08a41c1e1c0a7dd1840c7688c0797bc3 (patch) | |
tree | 056c834e2fed1795f3a81999fa9cab28293c7b4d | |
parent | 41325505e3606ce5f2a5565158a38298f3daa78a (diff) | |
parent | 1cc11dbf58edca1e049c5f518deeaf6332b7c633 (diff) |
Merge pull request #80 from ctiller/mac
Fix run_test.py so it runs the first time
-rwxr-xr-x | tools/run_tests/run_tests.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 8c4c998d7b..e8c121456a 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -5,6 +5,7 @@ import argparse import glob import itertools import multiprocessing +import os import sys import time @@ -117,9 +118,10 @@ class TestCache(object): with open('.run_tests_cache', 'w') as f: f.write(simplejson.dumps(self.dump())) - def load(self): - with open('.run_tests_cache') as f: - self.parse(simplejson.loads(f.read())) + def maybe_load(self): + if os.path.exists('.run_tests_cache'): + with open('.run_tests_cache') as f: + self.parse(simplejson.loads(f.read())) def _build_and_run(check_cancelled, newline_on_success, cache): @@ -158,7 +160,7 @@ test_cache = (None if runs_per_test != 1 or 'valgrind' in build_configs else TestCache()) if test_cache: - test_cache.load() + test_cache.maybe_load() if forever: success = True |