From db76ef54ac3d1575adedcd19ef268a569f85785f Mon Sep 17 00:00:00 2001 From: Daniel Brown <ddb@star.sr.bham.ac.uk> Date: Wed, 7 Aug 2013 12:35:59 +0100 Subject: [PATCH] adding kat version check --- pykat/testing/test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pykat/testing/test.py b/pykat/testing/test.py index d6a7d0e..7dc09c7 100644 --- a/pykat/testing/test.py +++ b/pykat/testing/test.py @@ -59,6 +59,10 @@ class FinesseTestProcess(Thread): self.test_id = test_id self.TEST_DIR = TEST_DIR self.BASE_DIR = BASE_DIR + + if os.path.exists(self.BASE_DIR): + shutil.rmtree(self.BASE_DIR) + self.emails = "" if type(nobuild) is str: @@ -167,6 +171,14 @@ class FinesseTestProcess(Thread): if not os.path.exists(FINESSE_EXE): raise Exception("Kat file was not found in " + FINESSE_EXE) + # check version numbers match up + out = utils.runcmd([FINESSE_EXE]) + + shortid = out[0].split("\n")[2].split("(build ")[-1].rstrip(")").split("-")[-1].lstrip("g") + + if shortid != self.git_commit[0:len(shortid)]: + raise Exception("Version of kat did not match the version that it was requested to build. Not sure why...") + self.built = True print "kat file found in " + FINESSE_EXE -- GitLab