aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmldesigner/data/fx/attributes.qml2
-rw-r--r--tests/auto/qml/qmldesigner/data/fx/empty.qml2
-rw-r--r--tests/auto/qml/qmldesigner/data/fx/helloworld.qml2
-rw-r--r--tests/auto/qml/qmldesigner/data/fx/properties.qml2
-rw-r--r--tests/auto/qml/qmldesigner/data/fx/states.qml2
-rw-r--r--tests/system/suite_general/tst_create_proj_wizard/test.py4
-rw-r--r--tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv2
-rw-r--r--tests/unit/unittest/clangformat-test.cpp154
8 files changed, 160 insertions, 10 deletions
diff --git a/tests/auto/qml/qmldesigner/data/fx/attributes.qml b/tests/auto/qml/qmldesigner/data/fx/attributes.qml
index f56ffd2b02..659a258105 100644
--- a/tests/auto/qml/qmldesigner/data/fx/attributes.qml
+++ b/tests/auto/qml/qmldesigner/data/fx/attributes.qml
@@ -23,7 +23,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 2.0
Item {
id: id;
diff --git a/tests/auto/qml/qmldesigner/data/fx/empty.qml b/tests/auto/qml/qmldesigner/data/fx/empty.qml
index 4b9e826d36..62221ea919 100644
--- a/tests/auto/qml/qmldesigner/data/fx/empty.qml
+++ b/tests/auto/qml/qmldesigner/data/fx/empty.qml
@@ -23,7 +23,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 2.0
Item {
}
diff --git a/tests/auto/qml/qmldesigner/data/fx/helloworld.qml b/tests/auto/qml/qmldesigner/data/fx/helloworld.qml
index 81980f966b..65b232de9b 100644
--- a/tests/auto/qml/qmldesigner/data/fx/helloworld.qml
+++ b/tests/auto/qml/qmldesigner/data/fx/helloworld.qml
@@ -23,7 +23,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 2.0
Rectangle {
width: 200
diff --git a/tests/auto/qml/qmldesigner/data/fx/properties.qml b/tests/auto/qml/qmldesigner/data/fx/properties.qml
index 2a38819230..ffeb68a0ea 100644
--- a/tests/auto/qml/qmldesigner/data/fx/properties.qml
+++ b/tests/auto/qml/qmldesigner/data/fx/properties.qml
@@ -23,7 +23,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 2.0
Item {
property bool pushed
diff --git a/tests/auto/qml/qmldesigner/data/fx/states.qml b/tests/auto/qml/qmldesigner/data/fx/states.qml
index 91e7348d24..b0dd3f3d38 100644
--- a/tests/auto/qml/qmldesigner/data/fx/states.qml
+++ b/tests/auto/qml/qmldesigner/data/fx/states.qml
@@ -23,7 +23,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 2.0
Rectangle {
id: rect
diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py
index 2c71b21c83..194d90aa9c 100644
--- a/tests/system/suite_general/tst_create_proj_wizard/test.py
+++ b/tests/system/suite_general/tst_create_proj_wizard/test.py
@@ -125,9 +125,7 @@ def handleBuildSystemVerifyKits(category, template, kits, displayedPlatforms,
test.log("Using build system '%s'" % buildSystem)
selectFromCombo(combo, buildSystem)
clickButton(waitForObject(":Next_QPushButton"))
- if template == "Qt Quick Application - Scroll":
- clickButton(waitForObject(":Next_QPushButton"))
- elif specialHandlingFunc:
+ if specialHandlingFunc:
specialHandlingFunc(displayedPlatforms, *args)
verifyKitCheckboxes(kits, displayedPlatforms)
safeClickButton("Cancel")
diff --git a/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv b/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv
index 1ac1dac7fd..6e594bcb6c 100644
--- a/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv
+++ b/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv
@@ -12646,8 +12646,6 @@
"bundledqt.qbs:4" "3"
"QPA plugin" "3"
"bundledqt.qbs:65" "4"
-"Qt libraries" "3"
-"bundledqt.qbs:30" "4"
"qt.conf" "3"
"bundledqt.qbs:22" "4"
"qt.conf" "4"
diff --git a/tests/unit/unittest/clangformat-test.cpp b/tests/unit/unittest/clangformat-test.cpp
index ad2c8bf3e3..44217b9876 100644
--- a/tests/unit/unittest/clangformat-test.cpp
+++ b/tests/unit/unittest/clangformat-test.cpp
@@ -404,6 +404,39 @@ TEST_F(ClangFormat, IndentEmptyLineInsideParantheses)
" && b)"));
}
+TEST_F(ClangFormat, IndentInsideIf)
+{
+ insertLines({"if (a && b",
+ ")"});
+
+ indenter.indentBlock(doc.findBlockByNumber(1), QChar::Null, TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("if (a && b",
+ " )"));
+}
+
+TEST_F(ClangFormat, IndentInsideIf2)
+{
+ insertLines({"if (a && b &&",
+ ")"});
+
+ indenter.indentBlock(doc.findBlockByNumber(1), QChar::Null, TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("if (a && b &&",
+ " )"));
+}
+
+TEST_F(ClangFormat, IndentInsideIf3)
+{
+ insertLines({"if (a || b",
+ ")"});
+
+ indenter.indentBlock(doc.findBlockByNumber(1), QChar::Null, TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("if (a || b",
+ " )"));
+}
+
TEST_F(ClangFormat, EmptyLineInInitializerList)
{
insertLines({"Bar foo{a,",
@@ -441,6 +474,31 @@ TEST_F(ClangFormat, DoNotIndentClosingBraceAfterSemicolon)
"}"));
}
+TEST_F(ClangFormat, IndentAfterIf)
+{
+ insertLines({"if (a)",
+ ""});
+
+ indenter.indentBlock(doc.findBlockByNumber(1), QChar::Null, TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("if (a)",
+ " "));
+}
+
+TEST_F(ClangFormat, IndentAfterElse)
+{
+ insertLines({"if (a)",
+ " foo();",
+ "else",
+ ""});
+ indenter.indentBlock(doc.findBlockByNumber(3), QChar::Null, TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("if (a)",
+ " foo();",
+ "else",
+ " "));
+}
+
TEST_F(ClangFormat, SameIndentAfterSecondNewLineAfterIf)
{
insertLines({"if (a)",
@@ -504,6 +562,102 @@ TEST_F(ClangFormat, SameIndentsOnNewLinesAfterComments)
""));
}
+TEST_F(ClangFormat, IndentAfterEmptyLineAfterAngledIncludeDirective)
+{
+ insertLines({"#include <string>",
+ "",
+ "using namespace std;"});
+
+ indenter.indentBlock(doc.findBlockByNumber(2), QChar::Null, TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("#include <string>",
+ "",
+ "using namespace std;"));
+}
+
+TEST_F(ClangFormat, IndentAfterEmptyLineAfterQuotedIncludeDirective)
+{
+ insertLines({"#include \"foo.h\"",
+ "",
+ "using namespace std;"});
+
+ indenter.indentBlock(doc.findBlockByNumber(2), QChar::Null, TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("#include \"foo.h\"",
+ "",
+ "using namespace std;"));
+}
+
+TEST_F(ClangFormat, IndentAfterLineComment)
+{
+ insertLines({"int foo()",
+ "{",
+ " // Comment",
+ " ",
+ " if (",
+ "}"});
+
+ indenter.indentBlock(doc.findBlockByNumber(4), '(', TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("int foo()",
+ "{",
+ " // Comment",
+ " ",
+ " if (",
+ "}"));
+}
+
+TEST_F(ClangFormat, IndentAfterBlockComment)
+{
+ insertLines({"int foo()",
+ "{",
+ " bar(); /* Comment */",
+ " ",
+ " if (",
+ "}"});
+
+ indenter.indentBlock(doc.findBlockByNumber(4), '(', TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("int foo()",
+ "{",
+ " bar(); /* Comment */",
+ " ",
+ " if (",
+ "}"));
+}
+
+TEST_F(ClangFormat, IndentAfterIfdef)
+{
+ insertLines({"int foo()",
+ "{",
+ "#ifdef FOO",
+ "#endif",
+ " ",
+ " if (",
+ "}"});
+
+ indenter.indentBlock(doc.findBlockByNumber(5), '(', TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("int foo()",
+ "{",
+ "#ifdef FOO",
+ "#endif",
+ " ",
+ " if (",
+ "}"));
+}
+
+TEST_F(ClangFormat, IndentAfterEmptyLineInTheFileBeginning)
+{
+ insertLines({"",
+ "void foo()"});
+
+ indenter.indentBlock(doc.findBlockByNumber(1), ')', TextEditor::TabSettings());
+
+ ASSERT_THAT(documentLines(), ElementsAre("",
+ "void foo()"));
+}
+
TEST_F(ClangFormat, IndentFunctionBodyButNotFormatBeforeIt)
{
insertLines({"int foo(int a, int b,",