aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlparser
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@qt.io>2020-02-10 13:15:37 +0100
committerFawzi Mohamed <fawzi.mohamed@qt.io>2020-02-12 17:51:29 +0100
commit8791fc19f04d51d1efc077205e39a11047e732b5 (patch)
tree54a6cdbffe75176c90782e1f3a049be8eb4a2c60 /tests/auto/qml/qqmlparser
parenta2b31f073530f61203fe0e9799ad158c4fe6b9f9 (diff)
Added AstDumper: better describe and compare AST trees
This is just added to the test sources (via tests/auto/shared/astdump.pri) Fixes: QTBUG-81819 Change-Id: Icc70e6f7a6ded9e9957c6d4151f696be34c942e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlparser')
-rw-r--r--tests/auto/qml/qqmlparser/qqmlparser.pro1
-rw-r--r--tests/auto/qml/qqmlparser/tst_qqmlparser.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlparser/qqmlparser.pro b/tests/auto/qml/qqmlparser/qqmlparser.pro
index d8e4b0dd06..7f117b3157 100644
--- a/tests/auto/qml/qqmlparser/qqmlparser.pro
+++ b/tests/auto/qml/qqmlparser/qqmlparser.pro
@@ -11,3 +11,4 @@ cross_compile: DEFINES += QTEST_CROSS_COMPILED
TESTDATA = data/*
include (../../shared/util.pri)
+include (../../shared/astdump.pri)
diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
index 0b88358d4a..c7d09f9d6e 100644
--- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
+++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
@@ -33,6 +33,7 @@
#include <private/qqmljsast_p.h>
#include "../../shared/util.h"
+#include "../../shared/qqmljsastdumper.h"
#include <qtest.h>
#include <QDir>
@@ -580,7 +581,7 @@ void tst_qqmlparser::annotations()
Parser parser2(&engine2);
QVERIFY(parser2.parse());
- // to do: compare for equality skipping annotations
+ QCOMPARE(AstDumper::diff(parser.ast(), parser2.rootNode(), 3, DumperOptions::NoAnnotations | DumperOptions::NoLocations), QString());
}
}