From a4a067d6b0c920d1d1765292998fe0cb458ba904 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= <henrik@tjaders.com>
Date: Wed, 19 Apr 2017 11:47:06 +0200
Subject: [PATCH] Also change the profiling script to use the last test

But to not trust the symlink
---
 profiling_db_parser.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/profiling_db_parser.py b/profiling_db_parser.py
index 23d32a6..c06c6be 100644
--- a/profiling_db_parser.py
+++ b/profiling_db_parser.py
@@ -120,9 +120,15 @@ def ktest_setdata(filename):
 
 
 def ktest_iterate():
-    """ Iterate over all files ending with ktest in klee-last folder """
+    """ Get the list of folders in current directory, sort and then grab the
+        last one.
+    """
+    dirlist = next(os.walk('.'))[1]
+    dirlist.sort()
+    directory = dirlist[-1]
+    print("Directory: " + directory)
 
-    directory = "klee-last"
+    """ Iterate over all files ending with ktest in "klee-last" folder """
     for filename in os.listdir(directory):
         if filename.endswith(".ktest"):
             file_list.append(os.path.join(directory, filename))
-- 
GitLab