about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2020-01-31 13:32:03 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-03-01 20:29:18 +0000
commitaedc84f95415cdeb384da85c1fd271564832870d (patch)
treeb3e120e9614b112c9949e8a760571e34d630f5ce
parent50d6e9107f9be104d2e1ca43e65c580d6430f555 (diff)
downloadklee-aedc84f95415cdeb384da85c1fd271564832870d.tar.gz
[klee-stats] Check if stats file exist before trying to open it
Providing a list of directories might sometimes not contain the stats file.
Check its existence before trying to access it.
-rwxr-xr-xtools/klee-stats/klee-stats6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/klee-stats/klee-stats b/tools/klee-stats/klee-stats
index 1a32432d..5bc00e04 100755
--- a/tools/klee-stats/klee-stats
+++ b/tools/klee-stats/klee-stats
@@ -305,8 +305,12 @@ def main():
     if len(dirs) == 0:
         print('no klee output dir found', file=sys.stderr)
         exit(1)
+
+    # Filter non-existing files, useful for star operations
+    valid_log_files = [getLogFile(f) for f in dirs if os.path.isfile(getLogFile(f))]
+
     # read contents from every run.stats file into LazyEvalList
-    data = [LazyEvalList(getLogFile(d)) for d in dirs]
+    data = [LazyEvalList(d) for d in valid_log_files]
 
     if args.toCsv:
         import csv