aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2020-06-02 14:43:05 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2020-06-03 19:51:17 +0200
commit5cc00daa7539a5e9339e29afce33adef707fb5bf (patch)
tree16e9550fad5786782ba7c98540637966cad2e0c0
parent5807d7ef2badd9a97a02cc77d56bb908835086f4 (diff)
Port shader effect autotest to RHI
The lookThroughShaderCode test function had to be removed, since it does not make sense when the shader code may not be available. Added testConnection() to verify that connections are made. Fixes: QTBUG-84123 Change-Id: I33594367bea97de9ef0d54711b105a33c8a57fa8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--tests/auto/quick/qquickshadereffect/CMakeLists.txt24
-rw-r--r--tests/auto/quick/qquickshadereffect/data/+qsb/red.fragbin0 -> 868 bytes
-rw-r--r--tests/auto/quick/qquickshadereffect/data/+qsb/test.fragbin0 -> 1254 bytes
-rw-r--r--tests/auto/quick/qquickshadereffect/data/+qsb/test.vertbin0 -> 1576 bytes
-rw-r--r--tests/auto/quick/qquickshadereffect/data/MyIcon.qml7
-rw-r--r--tests/auto/quick/qquickshadereffect/data/compile.bat4
-rw-r--r--tests/auto/quick/qquickshadereffect/data/connections.qml9
-rw-r--r--tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml7
-rw-r--r--tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml7
-rw-r--r--tests/auto/quick/qquickshadereffect/data/red.frag6
-rw-r--r--tests/auto/quick/qquickshadereffect/data/red_rhi.frag10
-rw-r--r--tests/auto/quick/qquickshadereffect/data/test.frag6
-rw-r--r--tests/auto/quick/qquickshadereffect/data/test.vert8
-rw-r--r--tests/auto/quick/qquickshadereffect/data/test_rhi.frag15
-rw-r--r--tests/auto/quick/qquickshadereffect/data/test_rhi.vert16
-rw-r--r--tests/auto/quick/qquickshadereffect/qquickshadereffect.pro3
-rw-r--r--tests/auto/quick/qquickshadereffect/resources.qrc16
-rw-r--r--tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp193
-rw-r--r--tests/auto/quick/quick.pro1
19 files changed, 138 insertions, 194 deletions
diff --git a/tests/auto/quick/qquickshadereffect/CMakeLists.txt b/tests/auto/quick/qquickshadereffect/CMakeLists.txt
index dbdf2610d2..5d36b7cba2 100644
--- a/tests/auto/quick/qquickshadereffect/CMakeLists.txt
+++ b/tests/auto/quick/qquickshadereffect/CMakeLists.txt
@@ -18,6 +18,30 @@ qt_add_test(tst_qquickshadereffect
Qt::QuickPrivate
)
+# Resources:
+set(resources_resource_files
+ "data/+qsb/red.frag"
+ "data/+qsb/test.frag"
+ "data/+qsb/test.vert"
+ "data/MyIcon.qml"
+ "data/connections.qml"
+ "data/deleteShaderEffectSource.qml"
+ "data/deleteSourceItem.qml"
+ "data/red.frag"
+ "data/star.png"
+ "data/test.frag"
+ "data/test.vert"
+ "data/twoImagesOneShaderEffect.qml"
+)
+
+qt_add_resource(tst_qquickshadereffect "resources"
+ PREFIX
+ "/"
+ FILES
+ ${resources_resource_files}
+)
+
+
## Scopes:
#####################################################################
diff --git a/tests/auto/quick/qquickshadereffect/data/+qsb/red.frag b/tests/auto/quick/qquickshadereffect/data/+qsb/red.frag
new file mode 100644
index 0000000000..695fa08edf
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/+qsb/red.frag
Binary files differ
diff --git a/tests/auto/quick/qquickshadereffect/data/+qsb/test.frag b/tests/auto/quick/qquickshadereffect/data/+qsb/test.frag
new file mode 100644
index 0000000000..412221f896
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/+qsb/test.frag
Binary files differ
diff --git a/tests/auto/quick/qquickshadereffect/data/+qsb/test.vert b/tests/auto/quick/qquickshadereffect/data/+qsb/test.vert
new file mode 100644
index 0000000000..b588ac26f6
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/+qsb/test.vert
Binary files differ
diff --git a/tests/auto/quick/qquickshadereffect/data/MyIcon.qml b/tests/auto/quick/qquickshadereffect/data/MyIcon.qml
index eb788fce7a..0ed8f36580 100644
--- a/tests/auto/quick/qquickshadereffect/data/MyIcon.qml
+++ b/tests/auto/quick/qquickshadereffect/data/MyIcon.qml
@@ -76,11 +76,6 @@ Item {
property Image source: visible ? image : null
- fragmentShader: "
- varying highp vec2 qt_TexCoord0;
- uniform sampler2D source;
- void main() {
- gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
- }"
+ fragmentShader: "qrc:/data/red.frag"
}
}
diff --git a/tests/auto/quick/qquickshadereffect/data/compile.bat b/tests/auto/quick/qquickshadereffect/data/compile.bat
new file mode 100644
index 0000000000..6b276aea69
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/compile.bat
@@ -0,0 +1,4 @@
+qsb -b --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/test.vert test_rhi.vert
+
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/red.frag red_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/test.frag test_rhi.frag
diff --git a/tests/auto/quick/qquickshadereffect/data/connections.qml b/tests/auto/quick/qquickshadereffect/data/connections.qml
new file mode 100644
index 0000000000..6c0df4be6e
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/connections.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+import ShaderEffectTest 1.0
+
+TestShaderEffect {
+ width:100;
+ height:100;
+ fragmentShader: "qrc:/data/test.frag"
+ vertexShader: "qrc:/data/test.vert"
+}
diff --git a/tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml b/tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml
index ec455e53f8..95fdfee91a 100644
--- a/tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml
+++ b/tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml
@@ -51,11 +51,6 @@ Rectangle {
sei.source = doomed;
doomed.destroy();
// now set a fragment shader to trigger source texture detection.
- sei.fragmentShader = "varying highp vec2 qt_TexCoord0;\
- uniform sampler2D source;\
- uniform lowp float qt_Opacity;\
- void main() {\
- gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity;\
- }";
+ sei.fragmentShader = "qrc:/data/test.frag";
}
}
diff --git a/tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml b/tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml
index 8fb9de0a33..9257e9a01a 100644
--- a/tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml
+++ b/tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml
@@ -52,11 +52,6 @@ Rectangle {
doomed.destroy();
sei.source = doomedses;
// now set a fragment shader to trigger source texture detection.
- sei.fragmentShader = "varying highp vec2 qt_TexCoord0;\
- uniform sampler2D source;\
- uniform lowp float qt_Opacity;\
- void main() {\
- gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity;\
- }";
+ sei.fragmentShader = "qrc:/data/test.frag";
}
}
diff --git a/tests/auto/quick/qquickshadereffect/data/red.frag b/tests/auto/quick/qquickshadereffect/data/red.frag
new file mode 100644
index 0000000000..08e3ddcd89
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/red.frag
@@ -0,0 +1,6 @@
+
+varying highp vec2 qt_TexCoord0;
+uniform sampler2D source;
+void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
diff --git a/tests/auto/quick/qquickshadereffect/data/red_rhi.frag b/tests/auto/quick/qquickshadereffect/data/red_rhi.frag
new file mode 100644
index 0000000000..d08a5db205
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/red_rhi.frag
@@ -0,0 +1,10 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+void main() {
+ fragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
diff --git a/tests/auto/quick/qquickshadereffect/data/test.frag b/tests/auto/quick/qquickshadereffect/data/test.frag
new file mode 100644
index 0000000000..79fa094f9d
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/test.frag
@@ -0,0 +1,6 @@
+varying highp vec2 qt_TexCoord0;
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity;
+}
diff --git a/tests/auto/quick/qquickshadereffect/data/test.vert b/tests/auto/quick/qquickshadereffect/data/test.vert
new file mode 100644
index 0000000000..5d7118cfb1
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/test.vert
@@ -0,0 +1,8 @@
+uniform highp mat4 qt_Matrix;
+attribute highp vec4 qt_Vertex;
+attribute highp vec2 qt_MultiTexCoord0;
+varying highp vec2 qt_TexCoord0;
+void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_Matrix * qt_Vertex;
+}
diff --git a/tests/auto/quick/qquickshadereffect/data/test_rhi.frag b/tests/auto/quick/qquickshadereffect/data/test_rhi.frag
new file mode 100644
index 0000000000..bd60894b65
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/test_rhi.frag
@@ -0,0 +1,15 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 qt_Matrix;
+ float qt_Opacity;
+} ubuf;
+
+void main() {
+ fragColor = texture(source, qt_TexCoord0) * ubuf.qt_Opacity;
+}
diff --git a/tests/auto/quick/qquickshadereffect/data/test_rhi.vert b/tests/auto/quick/qquickshadereffect/data/test_rhi.vert
new file mode 100644
index 0000000000..59a98fa813
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/data/test_rhi.vert
@@ -0,0 +1,16 @@
+#version 440
+
+layout(location = 0) in vec4 qt_Vertex;
+layout(location = 1) in vec2 qt_MultiTexCoord0;
+
+layout(location = 0) out vec2 qt_TexCoord0;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 qt_Matrix;
+ float qt_Opacity;
+} ubuf;
+
+void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = ubuf.qt_Matrix * qt_Vertex;
+}
diff --git a/tests/auto/quick/qquickshadereffect/qquickshadereffect.pro b/tests/auto/quick/qquickshadereffect/qquickshadereffect.pro
index 437a548a90..c6d2b36892 100644
--- a/tests/auto/quick/qquickshadereffect/qquickshadereffect.pro
+++ b/tests/auto/quick/qquickshadereffect/qquickshadereffect.pro
@@ -6,3 +6,6 @@ include (../../shared/util.pri)
macx:CONFIG -= app_bundle
QT += core-private gui-private qml-private quick-private testlib
+
+RESOURCES += \
+ resources.qrc
diff --git a/tests/auto/quick/qquickshadereffect/resources.qrc b/tests/auto/quick/qquickshadereffect/resources.qrc
new file mode 100644
index 0000000000..2789a6eecb
--- /dev/null
+++ b/tests/auto/quick/qquickshadereffect/resources.qrc
@@ -0,0 +1,16 @@
+<RCC>
+ <qresource prefix="/">
+ <file>data/connections.qml</file>
+ <file>data/deleteShaderEffectSource.qml</file>
+ <file>data/deleteSourceItem.qml</file>
+ <file>data/MyIcon.qml</file>
+ <file>data/star.png</file>
+ <file>data/test.frag</file>
+ <file>data/test.vert</file>
+ <file>data/twoImagesOneShaderEffect.qml</file>
+ <file>data/red.frag</file>
+ <file>data/+qsb/test.vert</file>
+ <file>data/+qsb/test.frag</file>
+ <file>data/+qsb/red.frag</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp b/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
index a57b7d4c1f..4f6e5235a8 100644
--- a/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
+++ b/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
@@ -75,10 +75,7 @@ public:
private slots:
void initTestCase();
void cleanupTestCase();
-
- void lookThroughShaderCode_data();
- void lookThroughShaderCode();
-
+ void testConnection();
void deleteSourceItem();
void deleteShaderEffectSource();
void twoImagesOneShaderEffect();
@@ -109,185 +106,29 @@ void tst_qquickshadereffect::cleanupTestCase()
{
}
-void tst_qquickshadereffect::lookThroughShaderCode_data()
-{
- QTest::addColumn<QByteArray>("vertexShader");
- QTest::addColumn<QByteArray>("fragmentShader");
- QTest::addColumn<int>("presenceFlags");
-
- QTest::newRow("default")
- << QByteArray("uniform highp mat4 qt_Matrix; \n"
- "attribute highp vec4 qt_Vertex; \n"
- "attribute highp vec2 qt_MultiTexCoord0; \n"
- "varying highp vec2 qt_TexCoord0; \n"
- "void main() { \n"
- " qt_TexCoord0 = qt_MultiTexCoord0; \n"
- " gl_Position = qt_Matrix * qt_Vertex; \n"
- "}")
- << QByteArray("varying highp vec2 qt_TexCoord0; \n"
- "uniform sampler2D source; \n"
- "uniform lowp float qt_Opacity; \n"
- "void main() { \n"
- " gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity; \n"
- "}")
- << (VertexPresent | TexCoordPresent | MatrixPresent | OpacityPresent | SourcePresent);
-
- QTest::newRow("empty")
- << QByteArray(" ") // one space -- if completely empty, default will be used instead.
- << QByteArray(" ")
- << 0;
-
-
- QTest::newRow("inside line comments")
- << QByteArray("//uniform highp mat4 qt_Matrix;\n"
- "attribute highp vec4 qt_Vertex;\n"
- "// attribute highp vec2 qt_MultiTexCoord0;")
- << QByteArray("uniform int source; // uniform lowp float qt_Opacity;")
- << (VertexPresent | SourcePresent);
-
- QTest::newRow("inside block comments")
- << QByteArray("/*uniform highp mat4 qt_Matrix;\n"
- "*/attribute highp vec4 qt_Vertex;\n"
- "/*/attribute highp vec2 qt_MultiTexCoord0;//**/")
- << QByteArray("/**/uniform int source; /* uniform lowp float qt_Opacity; */")
- << (VertexPresent | SourcePresent);
-
- QTest::newRow("inside preprocessor directive")
- << QByteArray("#define uniform\nhighp mat4 qt_Matrix;\n"
- "attribute highp vec4 qt_Vertex;\n"
- "#if\\\nattribute highp vec2 qt_MultiTexCoord0;")
- << QByteArray("uniform int source;\n"
- " # undef uniform lowp float qt_Opacity;")
- << (VertexPresent | SourcePresent);
-
-
- QTest::newRow("line comments between")
- << QByteArray("uniform//foo\nhighp//bar\nmat4//baz\nqt_Matrix;\n"
- "attribute//\nhighp//\nvec4//\nqt_Vertex;\n"
- " //*/ uniform \n attribute //\\ \n highp //// \n vec2 //* \n qt_MultiTexCoord0;")
- << QByteArray("uniform// lowp float qt_Opacity;\nsampler2D source;")
- << (VertexPresent | TexCoordPresent | MatrixPresent | SourcePresent);
-
- QTest::newRow("block comments between")
- << QByteArray("uniform/*foo*/highp/*/bar/*/mat4/**//**/qt_Matrix;\n"
- "attribute/**/highp/**/vec4/**/qt_Vertex;\n"
- " /* * */ attribute /*///*/ highp /****/ vec2 /**/ qt_MultiTexCoord0;")
- << QByteArray("uniform/*/ uniform//lowp/*float qt_Opacity;*/sampler2D source;")
- << (VertexPresent | TexCoordPresent | MatrixPresent | SourcePresent);
-
- QTest::newRow("preprocessor directive between")
- << QByteArray("uniform\n#foo\nhighp\n#bar\nmat4\n#baz\\\nblimey\nqt_Matrix;\n"
- "attribute\n#\nhighp\n#\nvec4\n#\nqt_Vertex;\n"
- " #uniform \n attribute \n # foo \n highp \n # bar \n vec2 \n#baz \n qt_MultiTexCoord0;")
- << QByteArray("uniform\n#if lowp float qt_Opacity;\nsampler2D source;")
- << (VertexPresent | TexCoordPresent | MatrixPresent | SourcePresent);
-
- QTest::newRow("newline between")
- << QByteArray("uniform\nhighp\nmat4\nqt_Matrix\n;\n"
- "attribute \t\r\n highp \n vec4 \n\n qt_Vertex ;\n"
- " \n attribute \n highp \n vec2 \n qt_Multi\nTexCoord0 \n ;")
- << QByteArray("uniform\nsampler2D\nsource;"
- "uniform lowp float qt_Opacity;")
- << (VertexPresent | MatrixPresent | OpacityPresent | SourcePresent);
-
-
- QTest::newRow("extra characters #1")
- << QByteArray("funiform highp mat4 qt_Matrix;\n"
- "attribute highp vec4 qt_Vertex_;\n"
- "attribute highp vec2 qqt_MultiTexCoord0;")
- << QByteArray("uniformm int source;\n"
- "uniform4 lowp float qt_Opacity;")
- << 0;
-
- QTest::newRow("extra characters #2")
- << QByteArray("attribute phighp vec4 qt_Vertex;\n"
- "attribute highpi vec2 qt_MultiTexCoord0;"
- "fattribute highp vec4 qt_Vertex;\n"
- "attributed highp vec2 qt_MultiTexCoord0;")
- << QByteArray(" ")
- << 0;
-
- QTest::newRow("missing characters #1")
- << QByteArray("unifor highp mat4 qt_Matrix;\n"
- "attribute highp vec4 qt_Vert;\n"
- "attribute highp vec2 MultiTexCoord0;")
- << QByteArray("niform int source;\n"
- "uniform qt_Opacity;")
- << 0;
-
- QTest::newRow("missing characters #2")
- << QByteArray("attribute high vec4 qt_Vertex;\n"
- "attribute ighp vec2 qt_MultiTexCoord0;"
- "tribute highp vec4 qt_Vertex;\n"
- "attrib highp vec2 qt_MultiTexCoord0;")
- << QByteArray(" ")
- << 0;
-
- QTest::newRow("precision")
- << QByteArray("uniform mat4 qt_Matrix;\n"
- "attribute kindofhighp vec4 qt_Vertex;\n"
- "attribute highp qt_MultiTexCoord0;\n")
- << QByteArray("uniform lowp float qt_Opacity;\n"
- "uniform mediump float source;\n")
- << (MatrixPresent | OpacityPresent | SourcePresent);
-
-
- QTest::newRow("property name #1")
- << QByteArray("uniform highp vec3 _0aA9zZ;")
- << QByteArray(" ")
- << int(SourcePresent);
-
- QTest::newRow("property name #2")
- << QByteArray("uniform mediump vec2 x86;")
- << QByteArray(" ")
- << int(SourcePresent);
-
- QTest::newRow("property name #3")
- << QByteArray("uniform lowp float X;")
- << QByteArray(" ")
- << int(SourcePresent);
-
- QTest::newRow("property name #4")
- << QByteArray("uniform highp mat4 mat4x4;")
- << QByteArray(" ")
- << int(SourcePresent);
-}
-
-void tst_qquickshadereffect::lookThroughShaderCode()
+void tst_qquickshadereffect::testConnection()
{
- QFETCH(QByteArray, vertexShader);
- QFETCH(QByteArray, fragmentShader);
- QFETCH(int, presenceFlags);
-
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.setData("import QtQuick 2.0\nimport ShaderEffectTest 1.0\nTestShaderEffect {}", QUrl());
- QScopedPointer<TestShaderEffect> item(qobject_cast<TestShaderEffect*>(component.create()));
- QCOMPARE(item->signalsConnected, 0);
+ // verify that the property notify signal is connected
+ QQuickView *view = new QQuickView(nullptr);
+ view->setSource(QUrl(QStringLiteral("qrc:/data/connections.qml")));
- QString expected;
- if ((presenceFlags & VertexPresent) == 0)
- expected += "Warning: Missing reference to \'qt_Vertex\'.\n";
- if ((presenceFlags & TexCoordPresent) == 0)
- expected += "Warning: Missing reference to \'qt_MultiTexCoord0\'.\n";
- if ((presenceFlags & MatrixPresent) == 0)
- expected += "Warning: Vertex shader is missing reference to \'qt_Matrix\'.\n";
- if ((presenceFlags & OpacityPresent) == 0)
- expected += "Warning: Shaders are missing reference to \'qt_Opacity\'.\n";
+ auto *shaderEffectItem = qobject_cast<TestShaderEffect*>(view->rootObject());
+ QVERIFY(shaderEffectItem);
+ QCOMPARE(shaderEffectItem->signalsConnected, 0);
- item->setVertexShader(vertexShader);
- item->setFragmentShader(fragmentShader);
- QCOMPARE(item->parseLog(), expected);
+ view->show();
+ QVERIFY(QTest::qWaitForWindowExposed(view));
- // If the uniform was successfully parsed, the notify signal has been connected to an update slot.
- QCOMPARE(item->signalsConnected, (presenceFlags & SourcePresent) ? 1 : 0);
+ QSGRendererInterface *rif = view->rendererInterface();
+ if (rif && rif->graphicsApi() != QSGRendererInterface::Software)
+ QCOMPARE(shaderEffectItem->signalsConnected, 1);
}
void tst_qquickshadereffect::deleteSourceItem()
{
// purely to ensure that deleting the sourceItem of a shader doesn't cause a crash
QQuickView *view = new QQuickView(nullptr);
- view->setSource(QUrl::fromLocalFile(testFile("deleteSourceItem.qml")));
+ view->setSource(QUrl(QStringLiteral("qrc:/data/deleteSourceItem.qml")));
view->show();
QVERIFY(QTest::qWaitForWindowExposed(view));
QVERIFY(view);
@@ -302,7 +143,7 @@ void tst_qquickshadereffect::deleteShaderEffectSource()
{
// purely to ensure that deleting the sourceItem of a shader doesn't cause a crash
QQuickView *view = new QQuickView(nullptr);
- view->setSource(QUrl::fromLocalFile(testFile("deleteShaderEffectSource.qml")));
+ view->setSource(QUrl(QStringLiteral("qrc:/data/deleteShaderEffectSource.qml")));
view->show();
QVERIFY(QTest::qWaitForWindowExposed(view));
QVERIFY(view);
@@ -315,9 +156,9 @@ void tst_qquickshadereffect::deleteShaderEffectSource()
void tst_qquickshadereffect::twoImagesOneShaderEffect()
{
- // purely to ensure that deleting the sourceItem of a shader doesn't cause a crash
+ // Don't crash when having a ShaderEffect and an Image sharing the texture via supportsAtlasTextures
QQuickView *view = new QQuickView(nullptr);
- view->setSource(QUrl::fromLocalFile(testFile("twoImagesOneShaderEffect.qml")));
+ view->setSource(QUrl(QStringLiteral("qrc:/data/twoImagesOneShaderEffect.qml")));
view->show();
QVERIFY(QTest::qWaitForWindowExposed(view));
QVERIFY(view);
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
index fada4a0d31..b65e167bce 100644
--- a/tests/auto/quick/quick.pro
+++ b/tests/auto/quick/quick.pro
@@ -16,6 +16,7 @@ qtConfig(opengl(es1|es2)?) {
qquickspritesequence
qtHaveModule(opengl): QUICKTESTS += qquickrendercontrol
+ QUICKTESTS += qquickshadereffect
# qquickshadereffect test is disabled for now, re-enable when ported to Qt 6
}