aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-01-05 10:33:43 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2018-01-05 10:33:59 +0100
commite1fd4f05b13292998dc8b2a3bf89369da5a062d9 (patch)
treeae5bb6d6344991f9bd0c456cbd97ab01081fc7b8 /tests/auto
parent2b0f23a49fb63d091c635ce449545a4ec9f5e5cc (diff)
parent3bde712fa2c1f926720e85d20ae7fd5f9f378fef (diff)
Merge 1.10 into master
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/blackbox/testdata/lexyacc/one-grammar/lexer.l1
-rw-r--r--tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs14
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp10
-rw-r--r--tests/auto/language/testdata/qbs-property-convenience-override.qbs6
-rw-r--r--tests/auto/language/tst_language.cpp19
-rw-r--r--tests/auto/language/tst_language.h1
6 files changed, 44 insertions, 7 deletions
diff --git a/tests/auto/blackbox/testdata/lexyacc/one-grammar/lexer.l b/tests/auto/blackbox/testdata/lexyacc/one-grammar/lexer.l
index 86f248a3c..4ba411106 100644
--- a/tests/auto/blackbox/testdata/lexyacc/one-grammar/lexer.l
+++ b/tests/auto/blackbox/testdata/lexyacc/one-grammar/lexer.l
@@ -3,6 +3,7 @@
#include <y.tab.h>
void yyerror(const char *e) { std::cerr << e; }
extern "C" int yywrap() { return 1; }
+extern YYSTYPE yylval;
%}
ID [a-z]+
diff --git a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs
index 97d602ced..a12aceccd 100644
--- a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs
+++ b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs
@@ -4,9 +4,16 @@ Project {
CppApplication {
name: "myapp"
files: ["main.cpp"]
- Depends { name: "plugin1"; cpp.link: false } // not to be linked
+ Depends {
+ name: "plugin1" // not to be linked
+ cpp.link: qbs.hostOS === undefined
+ }
Depends { name: "plugin2" } // not to be linked
- Depends { name: "plugin3"; cpp.link: true } // supposed to be linked
+ Depends {
+ name: "plugin3" // supposed to be linked
+ //property bool theCondition: true
+ cpp.link: /*theCondition && */product.name === "myapp" // TODO: Make this work
+ }
Depends { name: "plugin4" } // supposed to be linked
Depends { name: "helper" } // supposed to be linked
}
@@ -41,7 +48,8 @@ Project {
Depends { name: "cpp" }
Export {
Parameters {
- cpp.link: true
+ // property bool theCondition: true
+ cpp.link: true // theCondition TODO: Make this work
}
}
}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index de3268596..606a6e1d4 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -2068,10 +2068,12 @@ void TestBlackbox::reproducibleBuild()
QCOMPARE(runQbs(QbsRunParameters("clean")), 0);
QVERIFY(!object.exists());
QCOMPARE(runQbs(params), 0);
- QVERIFY(object.open(QIODevice::ReadOnly));
- const QByteArray newContents = object.readAll();
- QCOMPARE(oldContents == newContents, reproducible);
- object.close();
+ if (reproducible) {
+ QVERIFY(object.open(QIODevice::ReadOnly));
+ const QByteArray newContents = object.readAll();
+ QVERIFY(oldContents == newContents);
+ object.close();
+ }
QCOMPARE(runQbs(QbsRunParameters("clean")), 0);
}
diff --git a/tests/auto/language/testdata/qbs-property-convenience-override.qbs b/tests/auto/language/testdata/qbs-property-convenience-override.qbs
new file mode 100644
index 000000000..d4a8e7279
--- /dev/null
+++ b/tests/auto/language/testdata/qbs-property-convenience-override.qbs
@@ -0,0 +1,6 @@
+import qbs
+
+Product {
+ name: "p"
+ qbs.installPrefix: "/usr/local"
+}
diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp
index 8fcffcf5f..49f3ec20f 100644
--- a/tests/auto/language/tst_language.cpp
+++ b/tests/auto/language/tst_language.cpp
@@ -2398,6 +2398,25 @@ void TestLanguage::qbsPropertiesInProjectCondition()
QCOMPARE(exceptionCaught, false);
}
+void TestLanguage::qbsPropertyConvenienceOverride()
+{
+ bool exceptionCaught = false;
+ try {
+ SetupProjectParameters params = defaultParameters;
+ params.setProjectFilePath(testProject("qbs-property-convenience-override.qbs"));
+ params.setOverriddenValues({std::make_pair("qbs.installPrefix", "/opt")});
+ TopLevelProjectConstPtr project = loader->loadProject(params);
+ QVERIFY(!!project);
+ QCOMPARE(project->products.count(), 1);
+ QCOMPARE(project->products.first()->moduleProperties->qbsPropertyValue("installPrefix")
+ .toString(), QString("/opt"));
+ }
+ catch (const ErrorInfo &e) {
+ qDebug() << e.toString();
+ }
+ QCOMPARE(exceptionCaught, false);
+}
+
void TestLanguage::relaxedErrorMode()
{
m_logSink->setLogLevel(LoggerMinLevel);
diff --git a/tests/auto/language/tst_language.h b/tests/auto/language/tst_language.h
index 98a36937d..2a07e8e42 100644
--- a/tests/auto/language/tst_language.h
+++ b/tests/auto/language/tst_language.h
@@ -146,6 +146,7 @@ private slots:
void propertiesItemInModule();
void propertyAssignmentInExportedGroup();
void qbsPropertiesInProjectCondition();
+ void qbsPropertyConvenienceOverride();
void relaxedErrorMode();
void relaxedErrorMode_data();
void requiredAndNonRequiredDependencies();