From 144f3fe5a38d0cfe9778c855919a4ad26fa482fe Mon Sep 17 00:00:00 2001 From: Tatiana Borisova Date: Fri, 1 Oct 2021 11:02:36 +0300 Subject: [PATCH] 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 --- .../corelib/io/qstandardpaths/tst_qstandardpaths.cpp | 12 ++++++++---- 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 #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("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 #include #include +#if QT_CONFIG(process) #include +#endif #ifndef QT_NO_OPENGL #include @@ -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);