[Libreoffice-commits] core.git: test/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Sep 25 15:18:50 UTC 2018
test/source/screenshot_test.cxx | 41 ++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)
New commits:
commit 4c6733637d9c213b0dbd16df9de3b5713574644b
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Tue Sep 25 07:48:36 2018 +0200
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Sep 25 17:18:26 2018 +0200
screenshots: add better diagnostics for failing CI
Output current UI file being processed, in case any random exception
pops up.
Change-Id: If6937f70718cc801494f424f7e09e9cb8c8758f0
(cherry picked from commit fb5d849cdeebe5299da399efc9d0ca36b6fc192b)
Reviewed-on: https://gerrit.libreoffice.org/60964
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index 5f98430ebf53..3726afaeb716 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -247,26 +247,35 @@ void ScreenshotTest::processDialogBatchFile(const OUString& rFile)
while (aStream.ReadLine(aNextUIFile))
{
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
+ try
{
- // first check if it's a known dialog
- ScopedVclPtr<VclAbstractDialog> pDlg(createDialogByName(aNextUIFile));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
+ if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
{
- // unknown dialog, try fallback to generic created
- // VclBuilder-generated instance. Keep in mind that Dialogs
- // using this mechanism will probably not be layouted well
- // since the setup/initialization part is missing. Thus,
- // only use for fallback when only the UI file is available.
- dumpDialogToPath(aNextUIFile);
+ // first check if it's a known dialog
+ ScopedVclPtr<VclAbstractDialog> pDlg(createDialogByName(aNextUIFile));
+
+ if (pDlg)
+ {
+ // known dialog, dump screenshot to path
+ dumpDialogToPath(*pDlg);
+ }
+ else
+ {
+ // unknown dialog, try fallback to generic created
+ // VclBuilder-generated instance. Keep in mind that Dialogs
+ // using this mechanism will probably not be layouted well
+ // since the setup/initialization part is missing. Thus,
+ // only use for fallback when only the UI file is available.
+ dumpDialogToPath(aNextUIFile);
+ }
}
}
+ catch(...)
+ {
+ OString aMsg("Exception while processing ");
+ aMsg += aNextUIFile;
+ CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), false);
+ }
}
}
More information about the Libreoffice-commits
mailing list