From 729ecede246be700bd483ff47d5462814df08b82 Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Sat, 8 Aug 2020 10:04:55 +0200 Subject: klee-stats: check for a run.stats file in the klee-out directory, to prevent outputting wrong data. When KLEE crashes, it produces an empty info file, so it is not enough to check for the existence of an info file. Previously, table columns would mismatch and return data labeled with the wrong directory names. --- tools/klee-stats/klee-stats | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/klee-stats/klee-stats b/tools/klee-stats/klee-stats index 5a855705..49b101b3 100755 --- a/tools/klee-stats/klee-stats +++ b/tools/klee-stats/klee-stats @@ -99,16 +99,19 @@ def stripCommonPathPrefix(paths): return ['/'.join(p[i:]) for p in paths] +def isValidKleeOutDir(dir): + return os.path.exists(os.path.join(dir, 'info')) and os.path.exists(os.path.join(dir, 'run.stats')) + def getKleeOutDirs(dirs): kleeOutDirs = [] for dir in dirs: - if os.path.exists(os.path.join(dir, 'info')): + if isValidKleeOutDir(dir): kleeOutDirs.append(dir) else: for root, subdirs, _ in os.walk(dir): for d in subdirs: path = os.path.join(root, d) - if os.path.exists(os.path.join(path, 'info')): + if isValidKleeOutDir(path): kleeOutDirs.append(path) return kleeOutDirs -- cgit 1.4.1