daca2: run stable and unstable separately

This commit is contained in:
Daniel Marjamäki 2017-06-03 11:34:11 +02:00
parent 7ec3715c57
commit dd4353fac8
2 changed files with 52 additions and 32 deletions

View File

@ -31,11 +31,19 @@ def readdate(data):
return None return None
datepos = datepos + 1 datepos = datepos + 1
path = '.' daca2folder = os.path.expanduser('~/daca2/')
if len(sys.argv) == 2: path = ''
path = sys.argv[1] for arg in sys.argv[1:]:
if arg.startswith('--daca2='):
daca2folder = arg[8:]
if daca2folder[-1:] != '/':
daca2folder = daca2folder + '/'
else
path = arg
if daca2folder[-1:] != '/':
daca2folder = daca2folder + '/'
mainpage = open(path + '/daca2.html', 'wt') mainpage = open(path + 'daca2.html', 'wt')
mainpage.write('<!DOCTYPE html>\n') mainpage.write('<!DOCTYPE html>\n')
mainpage.write('<html lang="en">\n') mainpage.write('<html lang="en">\n')
mainpage.write('<head>\n') mainpage.write('<head>\n')
@ -64,10 +72,10 @@ mainpage.write(
lastupdate = None lastupdate = None
recent = [] recent = []
daca2 = os.path.expanduser('~/daca2/') daca2 = daca2folder
for lib in range(2): for lib in [False, True]:
for a in "0123456789abcdefghijklmnopqrstuvwxyz": for a in "0123456789abcdefghijklmnopqrstuvwxyz":
if lib == 1: if lib == True:
a = "lib" + a a = "lib" + a
if os.path.isfile(daca2 + a + '/results.txt'): if os.path.isfile(daca2 + a + '/results.txt'):
f = open(daca2 + a + '/results.txt', 'rt') f = open(daca2 + a + '/results.txt', 'rt')
@ -113,7 +121,7 @@ for lib in range(2):
data = data.replace('>', '&gt;') data = data.replace('>', '&gt;')
data = data.replace('\n', '\n') data = data.replace('\n', '\n')
f = open(path + '/daca2-' + a + '.html', 'wt') f = open(path + 'daca2-' + a + '.html', 'wt')
f.write('<!DOCTYPE html>\n') f.write('<!DOCTYPE html>\n')
f.write('<html lang="en">\n') f.write('<html lang="en">\n')
f.write('<head>\n') f.write('<head>\n')

View File

@ -17,14 +17,34 @@ for arg in sys.argv[1:]:
else: else:
PASSWORD = arg PASSWORD = arg
# Upload file to trac.cppcheck.net server using scp
def upload(file_to_upload, destination):
if not os.path.isfile(file_to_upload):
return
def compilecppcheck(CPPFLAGS):
subprocess.call(['nice', 'make', 'clean'])
subprocess.call(['nice', 'make', 'SRCDIR=build', 'CFGDIR=' + os.path.expanduser('~/cppcheck/cfg'), 'CXXFLAGS=-g -O2', 'CPPFLAGS=' + CPPFLAGS])
subprocess.call(['cp', 'cppcheck', os.path.expanduser('~/daca2/cppcheck-O2')])
def runcppcheck(rev, folder, destpath):
subprocess.call(['rm', '-rf', os.path.expanduser('~/daca2/' + folder)])
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2.py'), folder, '--rev=' + rev, '--skip=virtuoso-opensource'])
subprocess.call(['rm', '-rf', destpath + folder])
subprocess.call(['cp', '-R', os.path.expanduser('~/daca2/' + folder), destpath + folder])
subprocess.call(['cp', '', os.path.expanduser('~/daca2/' + folder)])
upload(os.path.expanduser('~/daca2/' + folder + '/results.txt'), 'evidente/results-' + folder + '.txt')
subprocess.call(['rm', '-rf', os.path.expanduser('~/daca2/lib' + folder)])
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2.py'), 'lib' + folder, '--rev=' + rev])
upload(os.path.expanduser('~/daca2/lib' + folder + '/results.txt'), 'evidente/results-lib' + folder + '.txt')
def daca2report(daca2folder):
subprocess.call(['rm', '-rf', os.path.expanduser('~/daca2-report')])
subprocess.call(['mkdir', os.path.expanduser('~/daca2-report')])
subprocess.call(['python', os.path.expanduser('~/cppcheck/tools/daca2-report.py'), '--daca2='+daca2folder, os.path.expanduser('~/daca2-report')])
# Upload file to sourceforge server using scp
def upload(folder):
try: try:
child = pexpect.spawn( child = pexpect.spawn(
'scp ' + file_to_upload + ' upload@trac.cppcheck.net:' + destination) 'scp -r ' + os.path.expanduser('~/daca2-report') + ' danmar,cppcheck@web.sf.net:htdocs/devinfo/' + folder)
child.expect('upload@trac.cppcheck.net\'s password:') child.expect('upload@trac.cppcheck.net\'s password:')
child.sendline(PASSWORD) child.sendline(PASSWORD)
child.interact() child.interact()
@ -43,32 +63,24 @@ def daca2(foldernum):
print('Daca2 folder=' + folder) print('Daca2 folder=' + folder)
os.chdir(os.path.expanduser('~/cppcheck')) os.chdir(os.path.expanduser('~/cppcheck'))
subprocess.call(['git', 'pull']) #subprocess.call(['git', 'pull'])
p = subprocess.Popen(['git', 'show', '--format=%h'], p = subprocess.Popen(['git', 'show', '--format=%h'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout=subprocess.PIPE, stderr=subprocess.PIPE)
comm = p.communicate() comm = p.communicate()
rev = comm[0] rev = comm[0]
rev = rev[:rev.find('\n')] rev = rev[:rev.find('\n')]
# compile cppcheck # unstable
subprocess.call(['nice', 'make', 'SRCDIR=build', 'CFGDIR=' + os.path.expanduser('~/cppcheck/cfg'), 'CXXFLAGS=-g -O2', 'CPPFLAGS=-DMAXTIME=600']) compilecppcheck('-DMAXTIME=600 -DUNSTABLE')
subprocess.call(['cp', 'cppcheck', os.path.expanduser('~/daca2/cppcheck-O2')]) runcppcheck(rev, folder, os.path.expanduser('~/daca2-unstable/'))
daca2report(os.path.expanduser('~/daca2-unstable/'))
#upload('daca2-unstable')
# run cppcheck # stable
subprocess.call(['rm', '-rf', os.path.expanduser('~/daca2/' + folder)]) compilecppcheck('-DMAXTIME=600')
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2.py'), folder, '--rev=' + rev, '--skip=virtuoso-opensource']) runcppcheck(rev, folder, os.path.expanduser('~/daca2-stable/'))
upload(os.path.expanduser('~/daca2/' + folder + '/results.txt'), 'evidente/results-' + folder + '.txt') daca2report(os.path.expanduser('~/daca2-stable/'))
subprocess.call(['rm', '-rf', os.path.expanduser('~/daca2/lib' + folder)]) #upload('daca2-stable')
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2.py'), 'lib' + folder, '--rev=' + rev])
upload(os.path.expanduser('~/daca2/lib' + folder + '/results.txt'), 'evidente/results-lib' + folder + '.txt')
# run cppcheck addons
subprocess.call(['rm', '-rf', os.path.expanduser('~/daca2/' + folder)])
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2-addons.py'), folder, '--rev=' + rev, '--skip=virtuoso-opensource'])
upload(os.path.expanduser('~/daca2/' + folder + '/results.txt'), 'evidente/addons-' + folder + '.txt')
subprocess.call(['rm', '-rf', os.path.expanduser('~/daca2/lib' + folder)])
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2-addons.py'), 'lib' + folder, '--rev=' + rev])
upload(os.path.expanduser('~/daca2/lib' + folder + '/results.txt'), 'evidente/addons-lib' + folder + '.txt')
foldernum = START foldernum = START
while True: while True: