forked from qt-creator/qt-creator
Squish: Test renaming of includes
Change-Id: I0c3d64ae6339ff41fc742b67618efbf69998c64e Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -73,11 +73,25 @@ def main():
|
||||
# end of handling QTCREATORBUG-10179
|
||||
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
|
||||
previous, filename)
|
||||
previous = filename
|
||||
# QTCREATORBUG-13176 does update the navigator async
|
||||
progressBarWait()
|
||||
if tempFiletype == "Headers": # QTCREATORBUG-13204
|
||||
verifyRenamedIncludes(templateDir, "main.cpp", previous, filename)
|
||||
verifyRenamedIncludes(templateDir, "utility.cpp", previous, filename)
|
||||
previous = filename
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
||||
def grep(pattern, text):
|
||||
return "\n".join(filter(lambda x: pattern in x, text.splitlines()))
|
||||
|
||||
def verifyRenamedIncludes(templateDir, file, oldname, newname):
|
||||
fileText = readFile(os.path.join(templateDir, file))
|
||||
if not (test.verify('#include "%s"' % oldname not in fileText,
|
||||
'Verify that old filename is no longer included in %s' % file) and
|
||||
test.verify('#include "%s"' % newname in fileText,
|
||||
'Verify that new filename is included in %s' % file)):
|
||||
test.log(grep("include", fileText))
|
||||
|
||||
def renameFile(projectDir, proFile, branch, oldname, newname):
|
||||
oldFilePath = os.path.join(projectDir, oldname)
|
||||
newFilePath = os.path.join(projectDir, newname)
|
||||
|
||||
Reference in New Issue
Block a user