D27805: Add a screenshot capture item and use it to test rendering

2020-05-19 Thread Arjen Hiemstra
ahiemstra abandoned this revision.
ahiemstra added a comment.


  Will continue this on Gitlab.

REPOSITORY
  R1049 KQuickCharts

REVISION DETAIL
  https://phabricator.kde.org/D27805

To: ahiemstra
Cc: davidedmundson, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, 
bruns


D27805: Add a screenshot capture item and use it to test rendering

2020-03-03 Thread David Edmundson
davidedmundson added a comment.


  I love the direction. +

INLINE COMMENTS

> ItemCapture.cpp:59
> +qWarning() << "No previous image found for capture" << d->name;
> +QVERIFY2(result->saveToFile(dir.absoluteFilePath(filePath)), "Unable 
> to store first version of capture.");
> +return;

I don't like how we're saving files into the user's source directory directly.

I'm sure we'll get lots of people forgetting to add the files and claiming it 
works because make test works the second time.

And we'll get other people committing lots of _new.png files committed 
accidentally.



I think a new temp dir would be best, alternatively we check some env 
variable/arg that a user can set to specify they want to generate a baseline

> ItemCapture.cpp:81
> +
> +QVERIFY2(dir.remove(filePath), "Could not remove old capture.");
> +QVERIFY2(dir.rename(newFilePath, filePath), "Could not rename new 
> capture.");

Why are we replacing the image if it's slightly different?

> ItemCapture.h:61
> + */
> +Q_PROPERTY(qreal errorMargin READ errorMargin WRITE setErrorMargin 
> NOTIFY errorMarginChanged)
> +

specify if 1% is

0.01 or 1 ?

> qmltest.cpp:22
> +
> +QUICK_TEST_MAIN_WITH_SETUP(Charts, Setup)
> +

I don't know what QUICK_TEXT_MAIN does, but we probably want to make sure we 
have:

QGuiApplication::setAttribute(AA_DisableHighDpiScaling, true);
QGuiApplication::setDesktopSettingsAware(false);

QQuickWindow::setTextRenderType(the qt rendering)

that should help generating the same thing across machines

REPOSITORY
  R1049 KQuickCharts

REVISION DETAIL
  https://phabricator.kde.org/D27805

To: ahiemstra
Cc: davidedmundson, kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, 
ngraham, bruns


D27805: Add a screenshot capture item and use it to test rendering

2020-03-03 Thread Arjen Hiemstra
ahiemstra created this revision.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
ahiemstra requested review of this revision.

REVISION SUMMARY
  This adds the ItemCapture item to the test runner, which can be
  used to capture images of items and compare them to a previous 
  version. It also updates the three chart tests to make use of
  this and adds the images for these tests.

TEST PLAN
  Autotests still pass.

REPOSITORY
  R1049 KQuickCharts

BRANCH
  screenshot_autotest

REVISION DETAIL
  https://phabricator.kde.org/D27805

AFFECTED FILES
  autotests/CMakeLists.txt
  autotests/ChartTestCase.qml
  autotests/ItemCapture.cpp
  autotests/ItemCapture.h
  autotests/qmltest.cpp
  autotests/screenshots/BarChart_simple.png
  autotests/screenshots/LineChart_simple.png
  autotests/screenshots/PieChart_model.png
  autotests/screenshots/PieChart_multiValue.png
  autotests/screenshots/PieChart_simple.png
  autotests/tst_BarChart.qml
  autotests/tst_LineChart.qml
  autotests/tst_PieChart.qml

To: ahiemstra
Cc: kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns