aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2020-08-15 15:03:44 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2020-09-01 16:11:59 +0000
commit7c15b368e2adcb917095cc46d07c7da5e97cc76d (patch)
tree420e16893168a10504ac5c7eb1765f898cbf491c /tests
parentb60f3409bbd6317de5f889d49055bee70648931b (diff)
Initial support for GitHub Actions
This commit adds jobs similar to what we have in Travis. Some tests are disabled when running on GitHub since they do not pass for various reasons. Note that those tests are usually skipped on Travis due to missing dependencies. Change-Id: Icec96dc22e2939d12568d2de1f1a4537c35977ad Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata-java/java/vehicles.qbs7
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp16
-rw-r--r--tests/auto/blackbox/tst_blackboxandroid.cpp4
-rw-r--r--tests/auto/blackbox/tst_blackboxapple.cpp2
-rw-r--r--tests/auto/blackbox/tst_blackboxjava.cpp3
5 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata-java/java/vehicles.qbs b/tests/auto/blackbox/testdata-java/java/vehicles.qbs
index fa632b7b3..633ee5abd 100644
--- a/tests/auto/blackbox/testdata-java/java/vehicles.qbs
+++ b/tests/auto/blackbox/testdata-java/java/vehicles.qbs
@@ -10,6 +10,13 @@ Project {
bundle.isBundle: false
}
+ property bool _testPlatform: {
+ var result = qbs.targetPlatform === qbs.hostPlatform;
+ if (!result)
+ console.info("targetPlatform differs from hostPlatform");
+ return result;
+ }
+
name: "native"
files: ["engine.c"]
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 335934882..59240642c 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1392,6 +1392,9 @@ void TestBlackbox::vcsSubversion()
if (svnFilePath.isEmpty())
QSKIP("svn not found");
+ if (HostOsInfo::isWindowsHost() && qEnvironmentVariableIsSet("GITHUB_ACTIONS"))
+ QSKIP("Skip this test when running on GitHub");
+
// Set up repo.
QTemporaryDir repoDir;
QVERIFY(repoDir.isValid());
@@ -7408,6 +7411,9 @@ void TestBlackbox::nodejs()
void TestBlackbox::typescript()
{
+ if (qEnvironmentVariableIsSet("GITHUB_ACTIONS"))
+ QSKIP("Skip this test when running on GitHub");
+
const SettingsPtr s = settings();
Profile p(profileName(), s.get());
@@ -7525,6 +7531,9 @@ void TestBlackbox::innoSetup()
return;
}
+ if (HostOsInfo::isWindowsHost() && qEnvironmentVariableIsSet("GITHUB_ACTIONS"))
+ QSKIP("Skip this test when running on GitHub");
+
QDir::setCurrent(testDataDir + "/innosetup");
QCOMPARE(runQbs(), 0);
QVERIFY(m_qbsStdout.contains("compiling test.iss"));
@@ -7535,6 +7544,9 @@ void TestBlackbox::innoSetup()
void TestBlackbox::innoSetupDependencies()
{
+ if (HostOsInfo::isWindowsHost() && qEnvironmentVariableIsSet("GITHUB_ACTIONS"))
+ QSKIP("Skip this test when running on GitHub");
+
const SettingsPtr s = settings();
Profile profile(profileName(), s.get());
@@ -7813,6 +7825,10 @@ void TestBlackbox::fallbackModuleProvider()
QFETCH(bool, fallbacksEnabledGlobally);
QFETCH(QStringList, pkgConfigLibDirs);
QFETCH(bool, successExpected);
+
+ if (HostOsInfo::isWindowsHost() && qEnvironmentVariableIsSet("GITHUB_ACTIONS"))
+ QSKIP("Skip this test when running on GitHub");
+
QDir::setCurrent(testDataDir + "/fallback-module-provider");
static const auto b2s = [](bool b) { return QString(b ? "true" : "false"); };
QbsRunParameters resolveParams("resolve",
diff --git a/tests/auto/blackbox/tst_blackboxandroid.cpp b/tests/auto/blackbox/tst_blackboxandroid.cpp
index 5e850874e..15b84a13b 100644
--- a/tests/auto/blackbox/tst_blackboxandroid.cpp
+++ b/tests/auto/blackbox/tst_blackboxandroid.cpp
@@ -84,6 +84,10 @@ void TestBlackboxAndroid::android()
QFETCH(bool, generateAab);
QFETCH(bool, isIncrementalBuild);
+ // skip tests on github except when run in docker - this var is not propagated into the image
+ if (qEnvironmentVariableIsSet("GITHUB_ACTIONS"))
+ QSKIP("Skip Android tests when running on GitHub");
+
const SettingsPtr s = settings();
Profile p(theProfileName(projectDir == "qml-app"), s.get());
if (!p.exists())
diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp
index d76aaf897..ea0d2ac58 100644
--- a/tests/auto/blackbox/tst_blackboxapple.cpp
+++ b/tests/auto/blackbox/tst_blackboxapple.cpp
@@ -759,6 +759,8 @@ void TestBlackboxApple::deploymentTarget_data()
void TestBlackboxApple::dmg()
{
+ if (qEnvironmentVariableIsSet("GITHUB_ACTIONS"))
+ QSKIP("Skip this test when running on GitHub");
QDir::setCurrent(testDataDir + "/apple-dmg");
QCOMPARE(runQbs(), 0);
}
diff --git a/tests/auto/blackbox/tst_blackboxjava.cpp b/tests/auto/blackbox/tst_blackboxjava.cpp
index a815a84ff..4400e1a35 100644
--- a/tests/auto/blackbox/tst_blackboxjava.cpp
+++ b/tests/auto/blackbox/tst_blackboxjava.cpp
@@ -73,6 +73,9 @@ void TestBlackboxJava::java()
QSKIP("java.jdkPath not set and automatic detection failed");
}
+ if (m_qbsStdout.contains("targetPlatform differs from hostPlatform"))
+ QSKIP("Skip test in cross-compiled build");
+
QCOMPARE(status, 0);
const QStringList classFiles =