From e9546c5042efee3e49b3c0e0fd067463b4f99069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 4 Dec 2011 21:46:56 +0100 Subject: [PATCH] extracttests.py: create output folders if they dont exist --- tools/extracttests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/extracttests.py b/tools/extracttests.py index 2f2200af6..ee0a24bff 100755 --- a/tools/extracttests.py +++ b/tools/extracttests.py @@ -5,6 +5,7 @@ Extract test cases information from Cppcheck test file """ +import os import sys import re @@ -179,6 +180,8 @@ if filename != None: elif htmldir != None: if not htmldir.endswith('/'): htmldir += '/' + if not os.path.exists(htmldir): + os.mkdir(htmldir) findex = open(htmldir + 'index.htm', 'w') findex.write('\n') findex.write('\n') @@ -241,6 +244,10 @@ if filename != None: if not codedir.endswith('/'): codedir = codedir + '/' + + if not os.path.exists(codedir): + os.mkdir(codedir) + errors = open(codedir+'errors.txt', 'w') for node in e.nodes: