diff options
author | Tatiana Borisova <tatiana.borisova@qt.io> | 2021-10-01 11:02:36 +0300 |
---|---|---|
committer | Tatiana Borisova <tatiana.borisova@qt.io> | 2021-10-15 11:00:25 +0300 |
commit | 144f3fe5a38d0cfe9778c855919a4ad26fa482fe (patch) | |
tree | 0ee5819dffc26ad76a335cabd5983b9e956df30e /tests | |
parent | 071ebc9eee5ea404e48b32983c80b066355df270 (diff) |
Fix autotest public API compilation for INTEGRITY
- getgid/getpwuid are not supported
- process should be used with config check
Task-number: QTBUG-96176
Pick-to: 6.2
Change-Id: Ib6854772bcf52f3533cb722f963426717926258b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp | 12 | ||||
-rw-r--r-- | tests/auto/other/lancelot/tst_lancelot.cpp | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index d9439d6d6b..d722b374d9 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -45,7 +45,7 @@ #include <pwd.h> #endif -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID) #define Q_XDG_PLATFORM #endif @@ -468,7 +468,9 @@ void tst_qstandardpaths::testRuntimeDirectory() #endif } -#ifdef Q_XDG_PLATFORM +// INTEGRITY PJF System doesn't support user ID related APIs. getpwuid is not defined. +// testCustomRuntimeDirectory_data test will always FAIL for INTEGRITY. +#if defined(Q_XDG_PLATFORM) && !defined(Q_OS_INTEGRITY) static QString fallbackXdgRuntimeDir() { static QString username = [] { @@ -491,7 +493,7 @@ static QString fallbackXdgRuntimeDir() { qunsetenv("XDG_RUNTIME_DIR"); #ifdef Q_XDG_PLATFORM -#ifndef Q_OS_WASM +#if !defined(Q_OS_WASM) && !defined(Q_OS_INTEGRITY) QTest::ignoreMessage(QtWarningMsg, qPrintable("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '" + fallbackXdgRuntimeDir() + '\'')); @@ -501,7 +503,9 @@ static QString fallbackXdgRuntimeDir() void tst_qstandardpaths::testCustomRuntimeDirectory_data() { -#if defined(Q_XDG_PLATFORM) +#ifdef Q_OS_INTEGRITY + QSKIP("Test requires getgid/getpwuid API that are not available on INTEGRITY"); +#elif defined(Q_XDG_PLATFORM) QTest::addColumn<RuntimeDirSetup>("setup"); auto addRow = [](const char *name, RuntimeDirSetup f) { QTest::newRow(name) << f; diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp index 602eef8322..0f136d4938 100644 --- a/tests/auto/other/lancelot/tst_lancelot.cpp +++ b/tests/auto/other/lancelot/tst_lancelot.cpp @@ -32,7 +32,9 @@ #include <QPainter> #include <QPdfWriter> #include <QTemporaryFile> +#if QT_CONFIG(process) #include <QProcess> +#endif #ifndef QT_NO_OPENGL #include <QOpenGLFramebufferObjectFormat> @@ -421,6 +423,7 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format, co rendered = fbo.toImage().convertToFormat(format); #endif } else if (engine == Pdf) { +#if QT_CONFIG(process) QString tempStem(QDir::tempPath() + QLatin1String("/lancelot_XXXXXX_") + qpsFile.chopped(4)); QTemporaryFile pdfFile(tempStem + QLatin1String(".pdf")); @@ -442,6 +445,7 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format, co proc.waitForFinished(2 * 60 * 1000); // May need some time rendered = QImage(pngFile.fileName()); +#endif } QBASELINE_TEST(rendered); |