summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/qshaderprogram/tst_qshaderprogram.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/render/qshaderprogram/tst_qshaderprogram.cpp')
-rw-r--r--tests/auto/render/qshaderprogram/tst_qshaderprogram.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/render/qshaderprogram/tst_qshaderprogram.cpp b/tests/auto/render/qshaderprogram/tst_qshaderprogram.cpp
index 901ee7349..3fcc49067 100644
--- a/tests/auto/render/qshaderprogram/tst_qshaderprogram.cpp
+++ b/tests/auto/render/qshaderprogram/tst_qshaderprogram.cpp
@@ -511,6 +511,24 @@ private Q_SLOTS:
QCOMPARE(status(), newStatus);
}
+ void checkIncludes()
+ {
+ // GIVEN
+ Qt3DRender::QShaderProgram shaderProgram;
+ QByteArray includedContent = shaderProgram.loadSource(QUrl(QStringLiteral("qrc:/included.frag")));
+
+ // WHEN (test relative include)
+ QByteArray mainContent = shaderProgram.loadSource(QUrl(QStringLiteral("qrc:/main.frag")));
+
+ // THEN
+ QVERIFY(mainContent.indexOf(includedContent) == 0);
+
+ // WHEN (test absolute include)
+ mainContent = shaderProgram.loadSource(QUrl(QStringLiteral("qrc:/mainabsolute.frag")));
+
+ // THEN
+ QVERIFY(mainContent.indexOf(includedContent) == 0);
+ }
};
QTEST_MAIN(tst_QShaderProgram)