From 47cb2e9d245db1cff18bea42512a1c1a717a43e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Thu, 8 Jul 2021 14:22:03 +0200 Subject: [PATCH] Squish: Update and stabilize tst_rename_file Change-Id: I1dae24e20d8c65b716dd988812eee013f0491603 Reviewed-by: Christian Stenger --- tests/system/suite_general/tst_rename_file/test.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/system/suite_general/tst_rename_file/test.py b/tests/system/suite_general/tst_rename_file/test.py index 5f867f1f983..413e0385b43 100644 --- a/tests/system/suite_general/tst_rename_file/test.py +++ b/tests/system/suite_general/tst_rename_file/test.py @@ -111,10 +111,18 @@ def renameFile(projectDir, proFile, branch, oldname, newname): " windowTitle='Rename More Files?'}}")) test.verify(waitFor("os.path.exists(newFilePath)", 1000), "Verify that file with new name exists: %s" % newFilePath) - test.compare(readFile(newFilePath), oldFileText, - "Comparing content of file before and after renaming") test.verify(waitFor("' ' + newname in safeReadFile(proFile)", 2000), "Verify that new filename '%s' was added to pro-file." % newname) + if oldname.endswith(".h"): + # Creator updates include guards in renamed header files and changes line breaks + oldFileText = oldFileText.replace("\r\n", "\n") + includeGuard = " " + newname.upper().replace(".", "_") + if not includeGuard.endswith("_H"): + includeGuard += "_H" + oldFileText = oldFileText.replace(" " + oldname.upper().replace(".", "_"), includeGuard) + waitFor("includeGuard in safeReadFile(newFilePath)", 2000) + test.compare(readFile(newFilePath), oldFileText, + "Comparing content of file before and after renaming") if oldname not in newname: test.verify(oldname not in readFile(proFile), "Verify that old filename '%s' was removed from pro-file." % oldname)