summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-07-23 17:55:26 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-08-15 20:41:07 +0300
commit188987eeb1f0a5e6211a82d370d4ea01372f5e7b (patch)
treefbf04a2017b4086b6428b885e2c397c5d3a174e3
parenta03912d2db83f4aa3882eef2521e09d08167a231 (diff)
downloadqtlocation-mapboxgl-188987eeb1f0a5e6211a82d370d4ea01372f5e7b.tar.gz
[build] Remove Qt test dependency on core
This test is testing the Qt bindings and should only link with QMapboxGL.
-rw-r--r--platform/qt/test/qmapboxgl.test.cpp15
-rw-r--r--platform/qt/test/qmapboxgl.test.hpp5
2 files changed, 13 insertions, 7 deletions
diff --git a/platform/qt/test/qmapboxgl.test.cpp b/platform/qt/test/qmapboxgl.test.cpp
index de0314f0ee..604bdde896 100644
--- a/platform/qt/test/qmapboxgl.test.cpp
+++ b/platform/qt/test/qmapboxgl.test.cpp
@@ -1,11 +1,14 @@
#include "qmapboxgl.test.hpp"
-#include <mbgl/util/io.hpp>
-
#include <QMapbox>
+#include <QFile>
+#include <QGuiApplication>
#include <QOpenGLContext>
#include <QOpenGLFunctions>
+#include <QTextStream>
+
+#include <mbgl/test/util.hpp>
QMapboxGLTest::QMapboxGLTest() : size(512, 512), fbo((assert(widget.context()->isValid()), widget.makeCurrent(), size)), map(nullptr, settings, size) {
connect(&map, SIGNAL(mapChanged(QMapboxGL::MapChange)),
@@ -43,8 +46,12 @@ void QMapboxGLTest::onNeedsRendering() {
TEST_F(QMapboxGLTest, TEST_DISABLED_ON_CI(styleJson)) {
- QString json = QString::fromStdString(
- mbgl::util::read_file("test/fixtures/resources/style_vector.json"));
+ QFile f("test/fixtures/resources/style_vector.json");
+
+ ASSERT_TRUE(f.open(QFile::ReadOnly | QFile::Text));
+
+ QTextStream in(&f);
+ QString json = in.readAll();
map.setStyleJson(json);
ASSERT_EQ(map.styleJson(), json);
diff --git a/platform/qt/test/qmapboxgl.test.hpp b/platform/qt/test/qmapboxgl.test.hpp
index 43a7c123b7..3591dbc9d8 100644
--- a/platform/qt/test/qmapboxgl.test.hpp
+++ b/platform/qt/test/qmapboxgl.test.hpp
@@ -1,11 +1,10 @@
-#include <mbgl/test/util.hpp>
-
-#include <QApplication>
#include <QMapboxGL>
#include <QGLWidget>
#include <QGLFramebufferObject>
+#include <gtest/gtest.h>
+
class QMapboxGLTest : public QObject, public ::testing::Test {
Q_OBJECT