tools: refactoring daca2
This commit is contained in:
parent
7d0075357e
commit
1b29a99e45
|
@ -230,9 +230,9 @@ if len(archives) == 0:
|
||||||
print('Sleep for 10 seconds..')
|
print('Sleep for 10 seconds..')
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
workdir = os.path.expanduser('~/daca2-addons/')
|
workdir = os.path.expanduser('~/daca2/')
|
||||||
|
|
||||||
print('~/daca2-addons/' + FOLDER)
|
print('~/daca2/' + FOLDER)
|
||||||
if not os.path.isdir(workdir + FOLDER):
|
if not os.path.isdir(workdir + FOLDER):
|
||||||
os.makedirs(workdir + FOLDER)
|
os.makedirs(workdir + FOLDER)
|
||||||
os.chdir(workdir + FOLDER)
|
os.chdir(workdir + FOLDER)
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
import pexpect
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
import time
|
|
||||||
import sys
|
|
||||||
|
|
||||||
PASSWORD = ''
|
|
||||||
if len(sys.argv) == 2:
|
|
||||||
PASSWORD = sys.argv[1]
|
|
||||||
|
|
||||||
# Upload file to sourceforge web server using scp
|
|
||||||
|
|
||||||
|
|
||||||
def upload(file_to_upload, destination):
|
|
||||||
if not os.path.isfile(file_to_upload):
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
child = pexpect.spawn(
|
|
||||||
'scp ' + file_to_upload + ' upload@trac.cppcheck.net:' + destination)
|
|
||||||
child.expect('upload@trac.cppcheck.net\'s password:')
|
|
||||||
child.sendline(PASSWORD)
|
|
||||||
child.interact()
|
|
||||||
except IOError:
|
|
||||||
pass
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
except pexpect.TIMEOUT:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def daca2(foldernum):
|
|
||||||
folders = '0123456789abcdefghijklmnopqrstuvwxyz'
|
|
||||||
folder = folders[foldernum % len(folders)]
|
|
||||||
|
|
||||||
print('Daca2 folder=' + folder)
|
|
||||||
|
|
||||||
os.chdir(os.path.expanduser('~/cppcheck'))
|
|
||||||
subprocess.call(['git', 'pull'])
|
|
||||||
p = subprocess.Popen(['git', 'show', '--format=%h'],
|
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
||||||
comm = p.communicate()
|
|
||||||
rev = comm[0]
|
|
||||||
rev = rev[:rev.find('\n')]
|
|
||||||
|
|
||||||
subprocess.call(['nice', 'make', 'SRCDIR=build', 'CFGDIR=' + os.path.expanduser('~/cppcheck/cfg'), 'CXXFLAGS=-O2', 'CPPFLAGS=-DMAXTIME=600'])
|
|
||||||
subprocess.call(['mv', 'cppcheck', os.path.expanduser('~/daca2-addons/cppcheck-O2')])
|
|
||||||
|
|
||||||
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2-addons.py'), folder, '--rev=' + rev])
|
|
||||||
upload(os.path.expanduser('~/daca2-addons/' + folder + '/results.txt'), 'evidente/addons-' + folder + '.txt')
|
|
||||||
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2-addons.py'), 'lib' + folder, '--rev=' + rev])
|
|
||||||
upload(os.path.expanduser('~/daca2-addons/lib' + folder + '/results.txt'), 'evidente/addons-lib' + folder + '.txt')
|
|
||||||
|
|
||||||
foldernum = 0
|
|
||||||
while True:
|
|
||||||
daca2(foldernum)
|
|
||||||
foldernum = foldernum + 1
|
|
|
@ -46,15 +46,25 @@ def daca2(foldernum):
|
||||||
rev = comm[0]
|
rev = comm[0]
|
||||||
rev = rev[:rev.find('\n')]
|
rev = rev[:rev.find('\n')]
|
||||||
|
|
||||||
|
# compile cppcheck
|
||||||
subprocess.call(['nice', 'make', 'SRCDIR=build', 'CFGDIR=' + os.path.expanduser('~/cppcheck/cfg'), 'CXXFLAGS=-O2', 'CPPFLAGS=-DMAXTIME=600'])
|
subprocess.call(['nice', 'make', 'SRCDIR=build', 'CFGDIR=' + os.path.expanduser('~/cppcheck/cfg'), 'CXXFLAGS=-O2', 'CPPFLAGS=-DMAXTIME=600'])
|
||||||
subprocess.call(['mv', 'cppcheck', os.path.expanduser('~/daca2/cppcheck-O2')])
|
subprocess.call(['mv', 'cppcheck', os.path.expanduser('~/daca2/cppcheck-O2')])
|
||||||
|
|
||||||
|
# run cppcheck
|
||||||
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2.py'), folder, '--rev=' + rev])
|
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2.py'), folder, '--rev=' + rev])
|
||||||
upload(os.path.expanduser('~/daca2/' + folder + '/results.txt'), 'evidente/results-' + folder + '.txt')
|
upload(os.path.expanduser('~/daca2/' + folder + '/results.txt'), 'evidente/results-' + folder + '.txt')
|
||||||
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2.py'), 'lib' + folder, '--rev=' + rev])
|
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')
|
upload(os.path.expanduser('~/daca2/lib' + folder + '/results.txt'), 'evidente/results-lib' + folder + '.txt')
|
||||||
|
|
||||||
|
# run cppcheck addons
|
||||||
|
subprocess.call(['nice', '--adjustment=19', 'python', os.path.expanduser('~/cppcheck/tools/daca2-addons.py'), folder, '--rev=' + rev])
|
||||||
|
upload(os.path.expanduser('~/daca2/'+folder+'/results.txt'), 'evidente/addons-'+folder+'.txt')
|
||||||
|
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 = 0
|
foldernum = 0
|
||||||
while True:
|
while True:
|
||||||
daca2(foldernum)
|
daca2(foldernum)
|
||||||
foldernum = foldernum + 1
|
foldernum = foldernum + 1
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue