diff options
author | homeboy445 <akshitsan13@gmail.com> | 2021-06-26 20:46:25 +0530 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-07-27 14:19:06 +0200 |
commit | 6cb3c79b84e396959a982070f6fc4d439a9c396d (patch) | |
tree | e76414396b63922a1b12b52193d30be2f2da1808 | |
parent | a66dc788d92d9ef0ab6a5a0339f02df0c39b97fb (diff) |
Added the feature to store VCL test results as a zip file
The results can now be downloaded as a zip file, which would
consist of the test log and all the resultant bitmap images produced
by the tests compressed as png stored in the user directory folder.
Change-Id: I8a6098a7454a621bbb9cafa7b6f2cafaa5503522
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117937
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | cui/source/dialogs/GraphicTestsDialog.cxx | 43 | ||||
-rw-r--r-- | cui/source/inc/GraphicsTestsDialog.hxx | 8 | ||||
-rw-r--r-- | include/svx/FileExportedDialog.hxx | 23 | ||||
-rw-r--r-- | include/vcl/test/GraphicsRenderTests.hxx | 2 | ||||
-rw-r--r-- | svx/Library_svx.mk | 1 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 2 | ||||
-rw-r--r-- | svx/source/dialog/FileExportedDialog.cxx | 42 | ||||
-rw-r--r-- | svx/source/dialog/SafeModeDialog.cxx | 35 | ||||
-rw-r--r-- | svx/uiconfig/ui/fileexporteddialog.ui (renamed from svx/uiconfig/ui/profileexporteddialog.ui) | 10 | ||||
-rw-r--r-- | vcl/backendtest/GraphicsRenderTests.cxx | 318 |
10 files changed, 435 insertions, 49 deletions
diff --git a/cui/source/dialogs/GraphicTestsDialog.cxx b/cui/source/dialogs/GraphicTestsDialog.cxx index 000129444cd5..0bd3bdd0fc39 100644 --- a/cui/source/dialogs/GraphicTestsDialog.cxx +++ b/cui/source/dialogs/GraphicTestsDialog.cxx @@ -7,6 +7,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <comphelper/backupfilehelper.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/DirectoryHelper.hxx> +#include <osl/file.hxx> +#include <unotools/ZipPackageHelper.hxx> #include <GraphicsTestsDialog.hxx> #include <vcl/test/GraphicsRenderTests.hxx> @@ -48,6 +53,10 @@ GraphicsTestsDialog::GraphicsTestsDialog(weld::Window* pParent) , m_xDownloadResults(m_xBuilder->weld_button("gptest_downld")) , m_xContainerBox(m_xBuilder->weld_box("gptest_box")) { + OUString userProfile = comphelper::BackupFileHelper::getUserProfileURL(); + m_xZipFileUrl = userProfile + "/GraphicTestResults.zip"; + m_xCreateFolderUrl = userProfile + "/GraphicTestResults"; + osl::Directory::create(m_xCreateFolderUrl); m_xDownloadResults->connect_clicked(LINK(this, GraphicsTestsDialog, HandleDownloadRequest)); } @@ -59,19 +68,41 @@ short GraphicsTestsDialog::run() + "\n(Click on any test to view its resultant bitmap image)"; m_xResultLog->set_text(aResultLog); sal_Int32 nTestNumber = 0; - for (VclTestResult& tests : aTestObject.getTestResults()) + for (VclTestResult& test : aTestObject.getTestResults()) { auto xGpTest = std::make_unique<GraphicTestEntry>(m_xContainerBox.get(), m_xDialog.get(), - tests.getTestName(), tests.getStatus(), - tests.getBitmap()); + test.getTestName(), test.getStatus(), + test.getBitmap()); m_xContainerBox->reorder_child(xGpTest->get_widget(), nTestNumber++); m_xGraphicTestEntries.push_back(std::move(xGpTest)); } return GenericDialogController::run(); } -IMPL_STATIC_LINK_NOARG(GraphicsTestsDialog, HandleDownloadRequest, weld::Button&, void) +IMPL_LINK_NOARG(GraphicsTestsDialog, HandleDownloadRequest, weld::Button&, void) { - //TODO: Enter code for downloading the results to user's system. - return; + osl::File::remove(m_xZipFileUrl); // Remove previous exports + try + { + utl::ZipPackageHelper aZipHelper(comphelper::getProcessComponentContext(), m_xZipFileUrl); + aZipHelper.addFolderWithContent(aZipHelper.getRootFolder(), m_xCreateFolderUrl); + aZipHelper.savePackage(); + } + catch (const std::exception&) + { + std::unique_ptr<weld::MessageDialog> xBox( + Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning, + VclButtonsType::Ok, "Creation of Zip file failed!")); + xBox->run(); + return; + } + FileExportedDialog aDialog( + m_xDialog.get(), + "The results have been successfully saved in the file 'GraphicTestResults.zip' !"); + aDialog.run(); +} + +GraphicsTestsDialog::~GraphicsTestsDialog() +{ + comphelper::DirectoryHelper::deleteDirRecursively(m_xCreateFolderUrl); } diff --git a/cui/source/inc/GraphicsTestsDialog.hxx b/cui/source/inc/GraphicsTestsDialog.hxx index 2912d898efb7..09e7fb28ff8e 100644 --- a/cui/source/inc/GraphicsTestsDialog.hxx +++ b/cui/source/inc/GraphicsTestsDialog.hxx @@ -12,6 +12,7 @@ #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <tools/link.hxx> +#include <svx/FileExportedDialog.hxx> #include "ImageViewerDialog.hxx" @@ -44,9 +45,14 @@ class GraphicsTestsDialog : public weld::GenericDialogController std::vector<std::unique_ptr<GraphicTestEntry>> m_xGraphicTestEntries; - DECL_STATIC_LINK(GraphicsTestsDialog, HandleDownloadRequest, weld::Button&, void); + OUString m_xZipFileUrl; + OUString m_xCreateFolderUrl; + + DECL_LINK(HandleDownloadRequest, weld::Button&, void); + DECL_LINK(HandleResultViewRequest, weld::Button&, void); public: GraphicsTestsDialog(weld::Window* pParent); + ~GraphicsTestsDialog(); virtual short run() override; }; diff --git a/include/svx/FileExportedDialog.hxx b/include/svx/FileExportedDialog.hxx new file mode 100644 index 000000000000..0fae918486d3 --- /dev/null +++ b/include/svx/FileExportedDialog.hxx @@ -0,0 +1,23 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <vcl/weld.hxx> +#include <svx/svxdllapi.h> + +class SVX_DLLPUBLIC FileExportedDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::Label> m_xFileLabel; + std::unique_ptr<weld::Button> m_xButton; + + DECL_LINK(OpenHdl, weld::Button&, void); + +public: + explicit FileExportedDialog(weld::Window* pParent, OUString atitle); +}; diff --git a/include/vcl/test/GraphicsRenderTests.hxx b/include/vcl/test/GraphicsRenderTests.hxx index d787b7ed012a..dd39cc16d815 100644 --- a/include/vcl/test/GraphicsRenderTests.hxx +++ b/include/vcl/test/GraphicsRenderTests.hxx @@ -45,6 +45,8 @@ class VCL_PLUGIN_PUBLIC GraphicsRenderTests std::vector<VclTestResult> m_aTestResult; //For storing the current graphics Backend in use. OUString m_aCurGraphicsBackend; + //Location where the results should be stored. + OUString m_aUserInstallPath; void testDrawRectWithRectangle(); void testDrawRectWithPixel(); diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index b6b97a76e0e6..578e7776ce8e 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -145,6 +145,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/dialog/rubydialog \ svx/source/dialog/rulritem \ svx/source/dialog/SafeModeDialog \ + svx/source/dialog/FileExportedDialog \ svx/source/dialog/SafeModeUI \ svx/source/dialog/SpellDialogChildWindow \ svx/source/dialog/srchctrl \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index d7343541b2fe..2186185f10c2 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -101,7 +101,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/paraulspacing \ svx/uiconfig/ui/passwd \ svx/uiconfig/ui/presetmenu \ - svx/uiconfig/ui/profileexporteddialog \ + svx/uiconfig/ui/fileexporteddialog \ svx/uiconfig/ui/querydeletecontourdialog \ svx/uiconfig/ui/querydeleteobjectdialog \ svx/uiconfig/ui/querydeletethemedialog \ diff --git a/svx/source/dialog/FileExportedDialog.cxx b/svx/source/dialog/FileExportedDialog.cxx new file mode 100644 index 000000000000..e352a0621f50 --- /dev/null +++ b/svx/source/dialog/FileExportedDialog.cxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <svx/FileExportedDialog.hxx> + +#include <tools/diagnose_ex.h> +#include <comphelper/backupfilehelper.hxx> +#include <comphelper/processfactory.hxx> +#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecuteFlags.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> + +FileExportedDialog::FileExportedDialog(weld::Window* pParent, OUString atitle) + : GenericDialogController(pParent, "svx/ui/fileexporteddialog.ui", "FileExportedDialog") + , m_xFileLabel(m_xBuilder->weld_label("Filelabel")) + , m_xButton(m_xBuilder->weld_button("ok")) +{ + m_xFileLabel->set_label(atitle); + m_xButton->connect_clicked(LINK(this, FileExportedDialog, OpenHdl)); +} + +IMPL_LINK_NOARG(FileExportedDialog, OpenHdl, weld::Button&, void) +{ + const OUString uri(comphelper::BackupFileHelper::getUserProfileURL()); + css::uno::Reference<css::system::XSystemShellExecute> exec( + css::system::SystemShellExecute::create(comphelper::getProcessComponentContext())); + try + { + exec->execute(uri, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY); + } + catch (const css::uno::Exception&) + { + TOOLS_WARN_EXCEPTION("svx.dialog", "opening <" << uri << "> failed:"); + } + m_xDialog->response(RET_OK); +}
\ No newline at end of file diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx index 9ebb269d0b7e..e9c99500a50a 100644 --- a/svx/source/dialog/SafeModeDialog.cxx +++ b/svx/source/dialog/SafeModeDialog.cxx @@ -19,6 +19,7 @@ #include <unotools/configmgr.hxx> #include <svx/dialmgr.hxx> #include <svx/strings.hrc> +#include <svx/FileExportedDialog.hxx> #include <com/sun/star/task/OfficeRestartManager.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> @@ -269,38 +270,6 @@ IMPL_LINK(SafeModeDialog, DialogBtnHdl, weld::Button&, rBtn, void) } } -namespace { - class ProfileExportedDialog : public weld::GenericDialogController - { - private: - std::unique_ptr<weld::Button> m_xButton; - - DECL_LINK(OpenHdl, weld::Button&, void); - public: - explicit ProfileExportedDialog(weld::Window* pParent); - }; - - ProfileExportedDialog::ProfileExportedDialog(weld::Window* pParent) - : GenericDialogController(pParent, "svx/ui/profileexporteddialog.ui", "ProfileExportedDialog") - , m_xButton(m_xBuilder->weld_button("ok")) - { - m_xButton->connect_clicked(LINK(this, ProfileExportedDialog, OpenHdl)); - } - - IMPL_LINK_NOARG(ProfileExportedDialog, OpenHdl, weld::Button&, void) - { - const OUString uri(comphelper::BackupFileHelper::getUserProfileURL()); - css::uno::Reference< css::system::XSystemShellExecute > exec( - css::system::SystemShellExecute::create(comphelper::getProcessComponentContext())); - try { - exec->execute(uri, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY); - } catch (const css::uno::Exception &) { - TOOLS_WARN_EXCEPTION("svx.dialog", "opening <" << uri << "> failed:"); - } - m_xDialog->response(RET_OK); - } -} - IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, weld::Button&, /*rBtn*/, void) { const OUString zipFileURL(comphelper::BackupFileHelper::getUserProfileURL() + "/libreoffice-profile.zip"); @@ -320,7 +289,7 @@ IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, weld::Button&, /*rBtn*/, void) return; } - ProfileExportedDialog aDialog(m_xDialog.get()); + FileExportedDialog aDialog(m_xDialog.get(),"Your user profile has been exported as 'libreoffice-profile.zip'."); aDialog.run(); } diff --git a/svx/uiconfig/ui/profileexporteddialog.ui b/svx/uiconfig/ui/fileexporteddialog.ui index fe73848d5014..aa1f3d4ae50f 100644 --- a/svx/uiconfig/ui/profileexporteddialog.ui +++ b/svx/uiconfig/ui/fileexporteddialog.ui @@ -2,10 +2,10 @@ <!-- Generated with glade 3.22.1 --> <interface domain="svx"> <requires lib="gtk+" version="3.20"/> - <object class="GtkDialog" id="ProfileExportedDialog"> + <object class="GtkDialog" id="FileExportedDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> - <property name="title" translatable="yes" context="profileexporteddialog|ProfileExportedDialog">Profile exported</property> + <property name="title" translatable="yes" context="fileexporteddialog|FileExportedDialog">File Exported</property> <property name="resizable">False</property> <property name="modal">True</property> <property name="default_width">0</property> @@ -42,7 +42,7 @@ </child> <child> <object class="GtkButton" id="ok"> - <property name="label" translatable="yes" context="profileexporteddialog|openfolder">Open Containing _Folder</property> + <property name="label" translatable="yes" context="fileexporteddialog|openfolder">Open Containing _Folder</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -63,10 +63,10 @@ </packing> </child> <child> - <object class="GtkLabel" id="label"> + <object class="GtkLabel" id="Filelabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes" context="profileexporteddialog|label">Your user profile has been exported as “libreoffice-profile.zip”.</property> + <property name="label" translatable="yes" context="fileexporteddialog|Filelabel">File Name</property> <property name="wrap">True</property> <property name="max_width_chars">80</property> <property name="lines">2</property> diff --git a/vcl/backendtest/GraphicsRenderTests.cxx b/vcl/backendtest/GraphicsRenderTests.cxx index 82b55f7450af..cd19d4255902 100644 --- a/vcl/backendtest/GraphicsRenderTests.cxx +++ b/vcl/backendtest/GraphicsRenderTests.cxx @@ -23,6 +23,17 @@ && aOutDevTest.getRenderBackendName() != "genpsp" \ && aOutDevTest.getRenderBackendName() != "win") +namespace +{ +void exportBitmapExToImage(OUString const& rImageName, BitmapEx& rBitmapEx) +{ + BitmapEx aBitmapEx(rBitmapEx); + aBitmapEx.Scale(Size(500, 500), BmpScaleFlag::Fast); + SvFileStream aStream(rImageName, StreamMode::WRITE | StreamMode::TRUNC); + GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, aStream); +} +} + OUString GraphicsRenderTests::returnTestStatus(vcl::test::TestResult const result) { switch (result) @@ -51,6 +62,11 @@ void GraphicsRenderTests::testDrawRectWithRectangle() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectWithPixel() @@ -66,6 +82,11 @@ void GraphicsRenderTests::testDrawRectWithPixel() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectWithLine() @@ -81,6 +102,11 @@ void GraphicsRenderTests::testDrawRectWithLine() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectWithPolygon() @@ -96,6 +122,11 @@ void GraphicsRenderTests::testDrawRectWithPolygon() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectWithPolyLine() @@ -111,6 +142,11 @@ void GraphicsRenderTests::testDrawRectWithPolyLine() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectWithPolyLineB2D() @@ -126,6 +162,11 @@ void GraphicsRenderTests::testDrawRectWithPolyLineB2D() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectWithPolyPolygon() @@ -141,6 +182,11 @@ void GraphicsRenderTests::testDrawRectWithPolyPolygon() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectWithPolyPolygonB2D() @@ -156,6 +202,11 @@ void GraphicsRenderTests::testDrawRectWithPolyPolygonB2D() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectAAWithRectangle() @@ -171,6 +222,11 @@ void GraphicsRenderTests::testDrawRectAAWithRectangle() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectAAWithPixel() @@ -186,6 +242,11 @@ void GraphicsRenderTests::testDrawRectAAWithPixel() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectAAWithLine() @@ -201,6 +262,11 @@ void GraphicsRenderTests::testDrawRectAAWithLine() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectAAWithPolygon() @@ -216,6 +282,11 @@ void GraphicsRenderTests::testDrawRectAAWithPolygon() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectAAWithPolyLine() @@ -231,6 +302,11 @@ void GraphicsRenderTests::testDrawRectAAWithPolyLine() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectAAWithPolyLineB2D() @@ -246,6 +322,11 @@ void GraphicsRenderTests::testDrawRectAAWithPolyLineB2D() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectAAWithPolyPolygon() @@ -261,6 +342,11 @@ void GraphicsRenderTests::testDrawRectAAWithPolyPolygon() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawRectAAWithPolyPolygonB2D() @@ -276,6 +362,11 @@ void GraphicsRenderTests::testDrawRectAAWithPolyPolygonB2D() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawFilledRectWithRectangle() @@ -292,11 +383,21 @@ void GraphicsRenderTests::testDrawFilledRectWithRectangle() = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } atestName += "WithAA"; aBitmap = aOutDevTest.setupFilledRectangle(true); eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawFilledRectWithPolygon() @@ -313,11 +414,21 @@ void GraphicsRenderTests::testDrawFilledRectWithPolygon() = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } atestName += "WithAA"; aBitmap = aOutDevTest.setupFilledRectangle(true); eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon() @@ -334,11 +445,21 @@ void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon() = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } atestName += "WithAA"; aBitmap = aOutDevTest.setupFilledRectangle(true); eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon2D() @@ -355,11 +476,21 @@ void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon2D() = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } atestName += "WithAA"; aBitmap = aOutDevTest.setupFilledRectangle(true); eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawDiamondWithPolygon() @@ -375,6 +506,11 @@ void GraphicsRenderTests::testDrawDiamondWithPolygon() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawDiamondWithLine() @@ -390,6 +526,11 @@ void GraphicsRenderTests::testDrawDiamondWithLine() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawDiamondWithPolyline() @@ -405,6 +546,11 @@ void GraphicsRenderTests::testDrawDiamondWithPolyline() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawDiamondWithPolylineB2D() @@ -420,6 +566,11 @@ void GraphicsRenderTests::testDrawDiamondWithPolylineB2D() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawInvertWithRectangle() @@ -436,6 +587,11 @@ void GraphicsRenderTests::testDrawInvertWithRectangle() = vcl::test::OutputDeviceTestCommon::checkInvertRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawInvertN50WithRectangle() @@ -452,6 +608,11 @@ void GraphicsRenderTests::testDrawInvertN50WithRectangle() = vcl::test::OutputDeviceTestCommon::checkInvertN50Rectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawInvertTrackFrameWithRectangle() @@ -468,6 +629,11 @@ void GraphicsRenderTests::testDrawInvertTrackFrameWithRectangle() = vcl::test::OutputDeviceTestCommon::checkInvertTrackFrameRectangle(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawBezierWithPolylineB2D() @@ -483,6 +649,11 @@ void GraphicsRenderTests::testDrawBezierWithPolylineB2D() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkBezier(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawBezierAAWithPolylineB2D() @@ -498,6 +669,11 @@ void GraphicsRenderTests::testDrawBezierAAWithPolylineB2D() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkBezier(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawBitmap() @@ -514,6 +690,11 @@ void GraphicsRenderTests::testDrawBitmap() = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawTransformedBitmap() @@ -530,6 +711,11 @@ void GraphicsRenderTests::testDrawTransformedBitmap() = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawBitmapExWithAlpha() @@ -546,6 +732,11 @@ void GraphicsRenderTests::testDrawBitmapExWithAlpha() = vcl::test::OutputDeviceTestBitmap::checkBitmapExWithAlpha(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawMask() @@ -561,6 +752,11 @@ void GraphicsRenderTests::testDrawMask() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestBitmap::checkMask(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawBlend() @@ -576,6 +772,10 @@ void GraphicsRenderTests::testDrawBlend() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmapEx.GetBitmap() : Bitmap())); + if (m_aStoreResultantBitmap) + { + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawXor() @@ -591,6 +791,11 @@ void GraphicsRenderTests::testDrawXor() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestAnotherOutDev::checkXOR(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testClipRectangle() @@ -606,6 +811,11 @@ void GraphicsRenderTests::testClipRectangle() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestClip::checkClip(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testClipPolygon() @@ -621,6 +831,11 @@ void GraphicsRenderTests::testClipPolygon() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestClip::checkClip(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testClipPolyPolygon() @@ -636,6 +851,11 @@ void GraphicsRenderTests::testClipPolyPolygon() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestClip::checkClip(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testClipB2DPolyPolygon() @@ -651,6 +871,11 @@ void GraphicsRenderTests::testClipB2DPolyPolygon() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestClip::checkClip(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDrawOutDev() @@ -667,6 +892,11 @@ void GraphicsRenderTests::testDrawOutDev() = vcl::test::OutputDeviceTestAnotherOutDev::checkDrawOutDev(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testDashedLine() @@ -682,6 +912,11 @@ void GraphicsRenderTests::testDashedLine() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkDashedLine(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLinearGradient() @@ -698,6 +933,11 @@ void GraphicsRenderTests::testLinearGradient() = vcl::test::OutputDeviceTestGradient::checkLinearGradient(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLinearGradientAngled() @@ -714,6 +954,11 @@ void GraphicsRenderTests::testLinearGradientAngled() = vcl::test::OutputDeviceTestGradient::checkLinearGradientAngled(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLinearGradientBorder() @@ -730,6 +975,11 @@ void GraphicsRenderTests::testLinearGradientBorder() = vcl::test::OutputDeviceTestGradient::checkLinearGradientBorder(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLinearGradientIntensity() @@ -746,6 +996,11 @@ void GraphicsRenderTests::testLinearGradientIntensity() = vcl::test::OutputDeviceTestGradient::checkLinearGradientIntensity(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLinearGradientSteps() @@ -762,6 +1017,11 @@ void GraphicsRenderTests::testLinearGradientSteps() = vcl::test::OutputDeviceTestGradient::checkLinearGradientSteps(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testAxialGradient() @@ -778,6 +1038,11 @@ void GraphicsRenderTests::testAxialGradient() = vcl::test::OutputDeviceTestGradient::checkAxialGradient(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testRadialGradient() @@ -794,6 +1059,11 @@ void GraphicsRenderTests::testRadialGradient() = vcl::test::OutputDeviceTestGradient::checkRadialGradient(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testRadialGradientOfs() @@ -825,6 +1095,11 @@ void GraphicsRenderTests::testLineJoinBevel() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkLineJoinBevel(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLineJoinRound() @@ -840,6 +1115,11 @@ void GraphicsRenderTests::testLineJoinRound() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkLineJoinRound(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLineJoinMiter() @@ -855,6 +1135,11 @@ void GraphicsRenderTests::testLineJoinMiter() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkLineJoinMiter(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLineJoinNone() @@ -870,6 +1155,11 @@ void GraphicsRenderTests::testLineJoinNone() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkLineJoinNone(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLineCapRound() @@ -885,6 +1175,11 @@ void GraphicsRenderTests::testLineCapRound() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkLineCapRound(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLineCapSquare() @@ -900,6 +1195,11 @@ void GraphicsRenderTests::testLineCapSquare() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkLineCapSquare(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::testLineCapButt() @@ -915,6 +1215,11 @@ void GraphicsRenderTests::testLineCapButt() vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkLineCapButt(aBitmap); appendTestResult(atestName, returnTestStatus(eResult), (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", aBitmapEx); + } } void GraphicsRenderTests::runALLTests() @@ -1018,11 +1323,18 @@ OUString GraphicsRenderTests::getResultString() void GraphicsRenderTests::run(bool storeResultBitmap) { m_aStoreResultantBitmap = storeResultBitmap; + ::utl::Bootstrap::locateUserInstallation(m_aUserInstallPath); + if (storeResultBitmap) + { + m_aUserInstallPath += "/user/GraphicTestResults/"; + } + else + { + m_aUserInstallPath += "/user/"; + } runALLTests(); //Storing the test's results in the main user installation directory. - OUString aUserInstallPath; - ::utl::Bootstrap::locateUserInstallation(aUserInstallPath); - SvFileStream logFile(aUserInstallPath + "/user/GraphicsRenderTests.log", + SvFileStream logFile(m_aUserInstallPath + "GraphicsRenderTests.log", StreamMode::WRITE | StreamMode::TRUNC); std::unordered_map<OUString, std::vector<OUString>> aTests; for (VclTestResult& tests : m_aTestResult) |