summaryrefslogtreecommitdiff
path: root/include/vcl/test
diff options
context:
space:
mode:
authorhomeboy445 <akshitsan13@gmail.com>2021-06-22 16:54:34 +0530
committerTomaž Vajngerl <quikee@gmail.com>2021-07-10 00:34:38 +0200
commit3057ee8ba01535324f57978569526988664eb53a (patch)
treea3c0f880ccb2e9ce6cf957c46647621013c7d490 /include/vcl/test
parent56d7965b6c24915359f39f45f1696c6f1dc3d3c9 (diff)
Added support for viewing results in the VCL tests UI box
The user can now easily view the result of any VCL test by just clicking on it - which would show them the resultant bitmap of that corresponding test. Change-Id: I57c0c2ab3662a9abec45ba7fc230c9299dcd9279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117657 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/vcl/test')
-rw-r--r--include/vcl/test/GraphicsRenderTests.hxx39
1 files changed, 29 insertions, 10 deletions
diff --git a/include/vcl/test/GraphicsRenderTests.hxx b/include/vcl/test/GraphicsRenderTests.hxx
index bfe536b7aa53..7c0fca129669 100644
--- a/include/vcl/test/GraphicsRenderTests.hxx
+++ b/include/vcl/test/GraphicsRenderTests.hxx
@@ -17,19 +17,35 @@
#include <vector>
-class VCL_PLUGIN_PUBLIC GraphicsRenderTests
+class VCL_PLUGIN_PUBLIC VclTestResult
{
+ OUString m_aTestName;
+ //For storing the result of the test.
+ OUString m_aTestStatus;
+ //For storing the resultant bitmap correspondingly to the test.
+ Bitmap m_aResultantBitmap;
+
public:
- //For storing the results correspondingly to the tests.
- std::vector<OString> m_aPassed;
- std::vector<OString> m_aQuirky;
- std::vector<OString> m_aFailed;
- //For storing Skipped tests.
- std::vector<OString> m_aSkipped;
+ VclTestResult(OUString atestName, OUString atestStatus, Bitmap atestBitmap)
+ : m_aTestName(atestName)
+ , m_aTestStatus(atestStatus)
+ , m_aResultantBitmap(atestBitmap)
+ {
+ }
+ OUString getTestName() { return m_aTestName; }
+ OUString getStatus() { return m_aTestStatus; }
+ Bitmap getBitmap() { return m_aResultantBitmap; }
+};
+
+class VCL_PLUGIN_PUBLIC GraphicsRenderTests
+{
+ bool m_aStoreResultantBitmap;
+
+ //For storing the test's info
+ std::vector<VclTestResult> m_aTestResult;
//For storing the current graphics Backend in use.
OUString m_aCurGraphicsBackend;
-private:
void testDrawRectWithRectangle();
void testDrawRectWithPixel();
void testDrawRectWithLine();
@@ -86,9 +102,12 @@ private:
void testLineCapRound();
void testLineCapSquare();
void testLineCapButt();
- void updateResult(vcl::test::TestResult const result, OString atestname);
+ static OUString returnTestStatus(vcl::test::TestResult const result);
void runALLTests();
+ void appendTestResult(OUString aTestName, OUString aTestStatus, Bitmap aTestBitmap = Bitmap());
public:
- void run();
+ std::vector<VclTestResult>& getTestResults();
+ OUString getResultString();
+ void run(bool storeResultBitmap = false);
};