Compile autotests for Integrity
- process environment/DNS are OFF for INTEGRITY Task-number: QTBUG-96176 Pick-to: 6.2 Change-Id: I189a97f88c96a428586c31a66b8d250e04482900 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
e6892f38a0
commit
766904bf5b
@ -120,7 +120,7 @@ int pipes[2];
|
||||
|
||||
# special case begin
|
||||
# cxx11_future
|
||||
if (UNIX AND NOT ANDROID AND NOT QNX)
|
||||
if (UNIX AND NOT ANDROID AND NOT QNX AND NOT INTEGRITY)
|
||||
set(cxx11_future_TEST_LIBRARIES pthread)
|
||||
endif()
|
||||
qt_config_compile_test(cxx11_future
|
||||
|
@ -82,6 +82,10 @@ qt_internal_extend_target(QSQLiteDriverPlugin CONDITION UNIX AND NOT QT_FEATURE_
|
||||
HAVE_USLEEP=1
|
||||
)
|
||||
|
||||
qt_internal_extend_target(QSQLiteDriverPlugin CONDITION INTEGRITY
|
||||
COMPILE_OPTIONS -include qplatformdefs.h
|
||||
)
|
||||
|
||||
qt_internal_extend_target(QSQLiteDriverPlugin CONDITION QT_FEATURE_dlopen AND NOT QT_FEATURE_system_sqlite
|
||||
LIBRARIES
|
||||
${CMAKE_DL_LIBS}
|
||||
@ -91,6 +95,3 @@ qt_internal_extend_target(QSQLiteDriverPlugin CONDITION NOT QT_FEATURE_dlopen AN
|
||||
DEFINES
|
||||
SQLITE_OMIT_LOAD_EXTENSION
|
||||
)
|
||||
|
||||
#### Keys ignored in scope 12:.:../../../3rdparty:../../../3rdparty/sqlite.pri:INTEGRITY:
|
||||
# QMAKE_CFLAGS = "-include" "qplatformdefs.h"
|
||||
|
@ -5,6 +5,8 @@ add_subdirectory(qtconcurrentiteratekernel)
|
||||
add_subdirectory(qtconcurrentfiltermapgenerated)
|
||||
add_subdirectory(qtconcurrentmap)
|
||||
add_subdirectory(qtconcurrentmedian)
|
||||
add_subdirectory(qtconcurrentrun)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qtconcurrentrun)
|
||||
add_subdirectory(qtconcurrenttask)
|
||||
endif()
|
||||
add_subdirectory(qtconcurrentthreadengine)
|
||||
add_subdirectory(qtconcurrenttask)
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Generated from global.pro.
|
||||
|
||||
add_subdirectory(qcompare)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qcompare)
|
||||
endif()
|
||||
add_subdirectory(qflags)
|
||||
add_subdirectory(q_func_info)
|
||||
add_subdirectory(qgetputenv)
|
||||
@ -8,7 +9,9 @@ add_subdirectory(qglobal)
|
||||
add_subdirectory(qnumeric)
|
||||
add_subdirectory(qfloat16)
|
||||
add_subdirectory(qkeycombination)
|
||||
add_subdirectory(qnativeinterface)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qnativeinterface)
|
||||
endif()
|
||||
add_subdirectory(qrandomgenerator)
|
||||
add_subdirectory(qlogging)
|
||||
add_subdirectory(qtendian)
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <QTest>
|
||||
#include <QReadWriteLock>
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY)
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
@ -56,7 +56,7 @@ private Q_SLOTS:
|
||||
|
||||
void tst_QGlobalStatic::initTestCase()
|
||||
{
|
||||
#if defined(Q_OS_UNIX)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY)
|
||||
// The tests create a lot of threads, which require file descriptors. On systems like
|
||||
// OS X low defaults such as 256 as the limit for the number of simultaneously
|
||||
// open files is not sufficient.
|
||||
|
@ -24,7 +24,9 @@ add_subdirectory(qtemporaryfile)
|
||||
add_subdirectory(qurlquery)
|
||||
add_subdirectory(qurluts46)
|
||||
if(TARGET Qt::Concurrent)
|
||||
add_subdirectory(qdebug)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qdebug)
|
||||
endif()
|
||||
add_subdirectory(qlockfile)
|
||||
add_subdirectory(qurl)
|
||||
endif()
|
||||
|
@ -29,7 +29,9 @@
|
||||
|
||||
#include <QTest>
|
||||
#include <QTemporaryFile>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
#include <qdebug.h>
|
||||
@ -53,6 +55,10 @@
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_INTEGRITY
|
||||
#include "qplatformdefs.h"
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_VXWORKS)
|
||||
#define Q_NO_SYMLINKS
|
||||
#endif
|
||||
@ -397,7 +403,7 @@ void tst_QDir::mkdirRmdir()
|
||||
|
||||
void tst_QDir::mkdirOnSymlink()
|
||||
{
|
||||
#if !defined(Q_OS_UNIX) || defined(Q_NO_SYMLINKS)
|
||||
#if !defined(Q_OS_UNIX) || defined(Q_NO_SYMLINKS) || defined(Q_OS_INTEGRITY)
|
||||
QSKIP("Test only valid on an OS that supports symlinks");
|
||||
#else
|
||||
// Create the structure:
|
||||
|
@ -30,7 +30,9 @@
|
||||
|
||||
#include <QTest>
|
||||
#include <QtConcurrentRun>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
#include <QSemaphore>
|
||||
#include <QFutureSynchronizer>
|
||||
|
||||
|
@ -43,6 +43,10 @@
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_INTEGRITY
|
||||
#include "qplatformdefs.h"
|
||||
#endif
|
||||
|
||||
// Restore permissions so that the QTemporaryDir cleanup can happen
|
||||
class PermissionRestorer
|
||||
{
|
||||
|
@ -67,6 +67,10 @@
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_INTEGRITY
|
||||
#include "qplatformdefs.h"
|
||||
#endif
|
||||
|
||||
Q_DECLARE_METATYPE(QSettings::Format)
|
||||
|
||||
#ifndef QSETTINGS_P_H_VERSION
|
||||
|
@ -45,6 +45,10 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_INTEGRITY
|
||||
#include "qplatformdefs.h"
|
||||
#endif
|
||||
|
||||
class tst_QTemporaryDir : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -56,6 +56,10 @@
|
||||
#include <QStandardPaths>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_INTEGRITY
|
||||
#include "qplatformdefs.h"
|
||||
#endif
|
||||
|
||||
class tst_QTemporaryFile : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -23,7 +23,9 @@ if(TARGET Qt::Network)
|
||||
add_subdirectory(qeventloop)
|
||||
endif()
|
||||
if(TARGET Qt::Gui)
|
||||
add_subdirectory(qmetatype)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qmetatype)
|
||||
endif()
|
||||
add_subdirectory(qmimedata)
|
||||
add_subdirectory(qvariant)
|
||||
endif()
|
||||
|
@ -570,7 +570,8 @@ void tst_QEventLoop::deliverInDefinedOrder()
|
||||
using namespace DeliverInDefinedOrder;
|
||||
qMetaTypeId<QThread*>();
|
||||
QThread threads[NbThread];
|
||||
Object objects[NbObject];
|
||||
// GHS compiler needs the namespace prefix, despite using above.
|
||||
DeliverInDefinedOrder::Object objects[NbObject];
|
||||
for (int t = 0; t < NbThread; t++) {
|
||||
threads[t].start();
|
||||
}
|
||||
|
@ -7225,11 +7225,14 @@ void tst_QObject::checkArgumentsForNarrowing()
|
||||
|
||||
// integral to integral with different signedness. smaller ones tested above
|
||||
NARROWS(signed char, unsigned char);
|
||||
|
||||
// Issue is reported to Green Hills, 2021-09-14.
|
||||
#if !defined(Q_CC_GHS)
|
||||
NARROWS(signed char, unsigned short);
|
||||
NARROWS(signed char, unsigned int);
|
||||
NARROWS(signed char, unsigned long);
|
||||
NARROWS(signed char, unsigned long long);
|
||||
|
||||
#endif // Q_CC_GHS
|
||||
NARROWS(unsigned char, signed char);
|
||||
FITS(unsigned char, short);
|
||||
FITS(unsigned char, int);
|
||||
@ -7237,19 +7240,23 @@ void tst_QObject::checkArgumentsForNarrowing()
|
||||
FITS(unsigned char, long long);
|
||||
|
||||
NARROWS(short, unsigned short);
|
||||
#if !defined(Q_CC_GHS)
|
||||
NARROWS(short, unsigned int);
|
||||
NARROWS(short, unsigned long);
|
||||
NARROWS(short, unsigned long long);
|
||||
|
||||
NARROWS(short, unsigned long long);
|
||||
#endif // Q_CC_GHS
|
||||
NARROWS(unsigned short, short);
|
||||
|
||||
FITS(unsigned short, int);
|
||||
FITS(unsigned short, long);
|
||||
FITS(unsigned short, long long);
|
||||
|
||||
NARROWS(int, unsigned int);
|
||||
#if !defined(Q_CC_GHS)
|
||||
NARROWS(int, unsigned long);
|
||||
NARROWS(int, unsigned long long);
|
||||
|
||||
#endif // Q_CC_GHS
|
||||
NARROWS(unsigned int, int);
|
||||
NARROWS_IF(unsigned int, long, (sizeof(int) >= sizeof(long)));
|
||||
FITS(unsigned int, long long);
|
||||
@ -7307,17 +7314,19 @@ void tst_QObject::checkArgumentsForNarrowing()
|
||||
/* implicit */ operator double() const { return 42.0; }
|
||||
};
|
||||
|
||||
#if !defined(Q_CC_GHS)
|
||||
NARROWS(ConvertingToDouble, char);
|
||||
NARROWS(ConvertingToDouble, short);
|
||||
NARROWS(ConvertingToDouble, int);
|
||||
NARROWS(ConvertingToDouble, long);
|
||||
NARROWS(ConvertingToDouble, long long);
|
||||
NARROWS(ConvertingToDouble, float);
|
||||
#endif // Q_CC_GHS
|
||||
FITS(ConvertingToDouble, double);
|
||||
FITS(ConvertingToDouble, long double);
|
||||
|
||||
|
||||
// GCC and clang don't implement this properly yet:
|
||||
// GCC, GHS and clang don't implement this properly yet:
|
||||
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99625
|
||||
// https://bugs.llvm.org/show_bug.cgi?id=49676
|
||||
#if defined(Q_CC_MSVC) // at least since VS2017
|
||||
|
@ -27,7 +27,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <QTest>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QSystemSemaphore>
|
||||
|
@ -46,7 +46,9 @@
|
||||
#include <QTest>
|
||||
#include <QBuffer>
|
||||
#include <QTemporaryFile>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
|
||||
static const char *const additionalMimeFiles[] = {
|
||||
"yast2-metapackage-handler-mimetypes.xml",
|
||||
@ -676,7 +678,7 @@ void tst_QMimeDatabase::knownSuffix()
|
||||
|
||||
void tst_QMimeDatabase::symlinkToFifo() // QTBUG-48529
|
||||
{
|
||||
#ifdef Q_OS_UNIX
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY)
|
||||
QTemporaryDir tempDir;
|
||||
QVERIFY(tempDir.isValid());
|
||||
const QString dir = tempDir.path();
|
||||
@ -885,7 +887,7 @@ static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDa
|
||||
qWarning("%s does not exist.", qPrintable(umdCommand));
|
||||
return false;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(process)
|
||||
QElapsedTimer timer;
|
||||
QProcess proc;
|
||||
proc.setProcessChannelMode(QProcess::MergedChannels); // silence output
|
||||
@ -900,6 +902,7 @@ static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDa
|
||||
const bool success = proc.waitForFinished(UpdateMimeDatabaseTimeout);
|
||||
qDebug().noquote() << "runUpdateMimeDatabase: done,"
|
||||
<< success << timer.elapsed() << "ms";
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,9 @@
|
||||
|
||||
|
||||
#include <QTest>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
#include <quuid.h>
|
||||
|
@ -5,7 +5,9 @@ if(QT_FEATURE_thread)
|
||||
add_subdirectory(qatomicinteger)
|
||||
add_subdirectory(qatomicpointer)
|
||||
add_subdirectory(qresultstore)
|
||||
add_subdirectory(qfuture)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qfuture)
|
||||
endif()
|
||||
add_subdirectory(qfuturesynchronizer)
|
||||
add_subdirectory(qmutex)
|
||||
add_subdirectory(qmutexlocker)
|
||||
@ -28,11 +30,13 @@ if(QT_FEATURE_thread)
|
||||
# special case end
|
||||
add_subdirectory(qwaitcondition)
|
||||
add_subdirectory(qwritelocker)
|
||||
add_subdirectory(qpromise)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qpromise)
|
||||
endif()
|
||||
endif()
|
||||
# special case begin
|
||||
# QTBUG-87431
|
||||
if(TARGET Qt::Concurrent AND NOT ANDROID)
|
||||
if(TARGET Qt::Concurrent AND NOT ANDROID AND NOT INTEGRITY)
|
||||
add_subdirectory(qfuturewatcher)
|
||||
endif()
|
||||
# special case end
|
||||
|
@ -27,7 +27,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <QTest>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
#include <QTestEventLoop>
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Generated from tools.pro.
|
||||
|
||||
add_subdirectory(collections)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(collections)
|
||||
endif()
|
||||
add_subdirectory(containerapisymmetry)
|
||||
add_subdirectory(qalgorithms)
|
||||
add_subdirectory(qarraydata)
|
||||
@ -23,7 +24,9 @@ add_subdirectory(qmakearray)
|
||||
add_subdirectory(qmap)
|
||||
add_subdirectory(qmargins)
|
||||
add_subdirectory(qmessageauthenticationcode)
|
||||
add_subdirectory(qoffsetstringarray)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qoffsetstringarray)
|
||||
endif()
|
||||
add_subdirectory(qpair)
|
||||
add_subdirectory(qpoint)
|
||||
add_subdirectory(qpointf)
|
||||
|
@ -28,7 +28,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <QTest>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
#include <QtCore/QCommandLineParser>
|
||||
|
||||
Q_DECLARE_METATYPE(char**)
|
||||
|
@ -29,7 +29,9 @@
|
||||
#include <QTest>
|
||||
|
||||
#include <qhashfunctions.h>
|
||||
#if QT_CONFIG(process)
|
||||
#include <qprocess.h>
|
||||
#endif
|
||||
|
||||
class tst_QHashSeed : public QObject
|
||||
{
|
||||
@ -77,6 +79,7 @@ void tst_QHashSeed::environmentVariable_data()
|
||||
|
||||
void tst_QHashSeed::environmentVariable()
|
||||
{
|
||||
#if QT_CONFIG(process)
|
||||
QFETCH(QByteArray, envVar);
|
||||
QFETCH(bool, isZero);
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
@ -97,6 +100,7 @@ void tst_QHashSeed::environmentVariable()
|
||||
QByteArray line2 = helper.readLine().trimmed();
|
||||
QCOMPARE(line2, line1);
|
||||
QCOMPARE(line1 == "0", isZero);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QHashSeed::deterministicSeed()
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY)
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
@ -133,7 +133,7 @@ public:
|
||||
|
||||
void tst_QSharedPointer::initTestCase()
|
||||
{
|
||||
#if defined(Q_OS_UNIX)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY)
|
||||
// The tests create a lot of threads, which require file descriptors. On systems like
|
||||
// OS X low defaults such as 256 as the limit for the number of simultaneously
|
||||
// open files is not sufficient.
|
||||
|
@ -31,8 +31,9 @@
|
||||
#include <QBuffer>
|
||||
#include <QStandardPaths>
|
||||
#include <QPainter>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
|
||||
#endif
|
||||
#include <qicon.h>
|
||||
#include <qiconengine.h>
|
||||
|
||||
|
@ -43,6 +43,10 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_INTEGRITY
|
||||
#include "qplatformdefs.h"
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
typedef QMap<QString, QString> QStringMap;
|
||||
|
@ -30,8 +30,9 @@
|
||||
#include <QTest>
|
||||
#include <QMimeData>
|
||||
#include <QSignalSpy>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
|
||||
#endif
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDir>
|
||||
|
@ -2846,7 +2846,7 @@ void tst_QPainter::monoImages()
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_AIX) && !defined(Q_CC_MSVC) && !defined(Q_OS_SOLARIS) && !defined(__UCLIBC__)
|
||||
#if !defined(Q_OS_AIX) && !defined(Q_CC_MSVC) && !defined(Q_OS_SOLARIS) && !defined(__UCLIBC__) && !defined(Q_OS_INTEGRITY)
|
||||
#include <fenv.h>
|
||||
|
||||
static const QString fpeExceptionString(int exception)
|
||||
|
@ -29,7 +29,9 @@
|
||||
#include <QTest>
|
||||
#include <QBuffer>
|
||||
#include <QtEndian>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
|
||||
#include <qfont.h>
|
||||
#include <private/qfont_p.h>
|
||||
|
@ -30,7 +30,9 @@
|
||||
#include <QUndoStack>
|
||||
#include <QAction>
|
||||
#include <QSignalSpy>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
#include <QLibraryInfo>
|
||||
#include <QTranslator>
|
||||
|
||||
|
@ -31,7 +31,9 @@
|
||||
#include <QAction>
|
||||
#include <QUndoStack>
|
||||
#include <QSignalSpy>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
#include <QTranslator>
|
||||
#include <QLibraryInfo>
|
||||
|
||||
|
@ -32,7 +32,9 @@
|
||||
#include <QSemaphore>
|
||||
#include <QTestEventLoop>
|
||||
#include <QSignalSpy>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
#include <QTimer>
|
||||
#include <QWaitCondition>
|
||||
#include <QScopeGuard>
|
||||
@ -92,6 +94,10 @@ Q_DECLARE_METATYPE(QSharedPointer<char>)
|
||||
|
||||
#include "../../../network-settings.h"
|
||||
|
||||
#ifdef Q_OS_INTEGRITY
|
||||
#include "qplatformdefs.h"
|
||||
#endif
|
||||
|
||||
Q_DECLARE_METATYPE(QAuthenticator*)
|
||||
#if QT_CONFIG(networkproxy)
|
||||
Q_DECLARE_METATYPE(QNetworkProxyQuery)
|
||||
|
@ -1,14 +1,15 @@
|
||||
# Generated from kernel.pro.
|
||||
|
||||
add_subdirectory(qdnslookup)
|
||||
add_subdirectory(qdnslookup_appless)
|
||||
if(NOT INTEGRITY)
|
||||
add_subdirectory(qdnslookup)
|
||||
add_subdirectory(qdnslookup_appless)
|
||||
endif()
|
||||
add_subdirectory(qnetworkproxyfactory)
|
||||
add_subdirectory(qnetworkproxy)
|
||||
add_subdirectory(qnetworkinterface)
|
||||
add_subdirectory(qnetworkdatagram)
|
||||
add_subdirectory(qnetworkaddressentry)
|
||||
add_subdirectory(qhostaddress)
|
||||
if(QT_FEATURE_private_tests AND NOT MACOS)
|
||||
if(QT_FEATURE_private_tests AND NOT MACOS AND NOT INTEGRITY)
|
||||
add_subdirectory(qhostinfo)
|
||||
endif()
|
||||
if(QT_FEATURE_private_tests)
|
||||
|
@ -30,7 +30,9 @@
|
||||
|
||||
#include <QTest>
|
||||
#include <QSignalSpy>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
#include <QWaitCondition>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMutex>
|
||||
|
@ -31,7 +31,9 @@
|
||||
#include <QTest>
|
||||
#include <QSignalSpy>
|
||||
#include <QtEndian>
|
||||
#if QT_CONFIG(process)
|
||||
#include <QProcess>
|
||||
#endif
|
||||
#include <QScopeGuard>
|
||||
#include <QVersionNumber>
|
||||
|
||||
|
@ -32,7 +32,7 @@ qt_internal_add_test(tst_qaccessibility
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_extend_target(tst_qaccessibility CONDITION UNIX AND NOT APPLE AND NOT HAIKU AND NOT integity
|
||||
qt_internal_extend_target(tst_qaccessibility CONDITION UNIX AND NOT APPLE AND NOT HAIKU AND NOT INTEGRITY
|
||||
PUBLIC_LIBRARIES
|
||||
m
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Generated from printsupport.pro.
|
||||
|
||||
if(NOT QT_FEATURE_printer)
|
||||
if(NOT QT_FEATURE_printer OR NOT QT_FEATURE_printdialog)
|
||||
return()
|
||||
endif()
|
||||
add_subdirectory(dialogs)
|
||||
|
@ -33,10 +33,11 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY)
|
||||
# include <unistd.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/wait.h>
|
||||
# define USE_PIPE_EXEC
|
||||
#endif
|
||||
|
||||
|
||||
@ -63,9 +64,9 @@ private:
|
||||
QString getDefaultPrinterFromSystem();
|
||||
QStringList getPrintersFromSystem();
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#ifdef USE_PIPE_EXEC
|
||||
QString getOutputFromCommand(const QStringList& command);
|
||||
#endif // Q_OS_UNIX
|
||||
#endif // USE_PIPE_EXEC
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -89,7 +90,7 @@ QString tst_QPrinterInfo::getDefaultPrinterFromSystem()
|
||||
#ifdef Q_OS_WIN32
|
||||
// TODO "cscript c:\windows\system32\prnmngr.vbs -g"
|
||||
#endif // Q_OS_WIN32
|
||||
#ifdef Q_OS_UNIX
|
||||
#ifdef USE_PIPE_EXEC
|
||||
QStringList command;
|
||||
command << "lpstat" << "-d";
|
||||
QString output = getOutputFromCommand(command);
|
||||
@ -103,7 +104,7 @@ QString tst_QPrinterInfo::getDefaultPrinterFromSystem()
|
||||
QRegularExpression defaultReg("default.*: *([a-zA-Z0-9_-]+)");
|
||||
match = defaultReg.match(output);
|
||||
printer = match.captured(1);
|
||||
#endif // Q_OS_UNIX
|
||||
#endif // USE_PIPE_EXEC
|
||||
return printer;
|
||||
}
|
||||
|
||||
@ -114,7 +115,7 @@ QStringList tst_QPrinterInfo::getPrintersFromSystem()
|
||||
#ifdef Q_OS_WIN32
|
||||
// TODO "cscript c:\windows\system32\prnmngr.vbs -l"
|
||||
#endif // Q_OS_WIN32
|
||||
#ifdef Q_OS_UNIX
|
||||
#ifdef USE_PIPE_EXEC
|
||||
QString output = getOutputFromCommand({ "lpstat", "-e" });
|
||||
QStringList list = output.split(QChar::fromLatin1('\n'));
|
||||
|
||||
@ -127,12 +128,12 @@ QStringList tst_QPrinterInfo::getPrintersFromSystem()
|
||||
ans << printer;
|
||||
}
|
||||
}
|
||||
#endif // Q_OS_UNIX
|
||||
#endif // USE_PIPE_EXEC
|
||||
|
||||
return ans;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#ifdef USE_PIPE_EXEC
|
||||
// This function does roughly the same as the `command substitution` in
|
||||
// the shell.
|
||||
QString getOutputFromCommandInternal(const QStringList &command)
|
||||
|
@ -52,7 +52,7 @@ namespace QTestLocaleChange {
|
||||
const int m_category;
|
||||
const QByteArray m_prior;
|
||||
const bool m_didSet;
|
||||
#if !defined(QT_NO_SYSTEMLOCALE) && defined(Q_OS_UNIX) \
|
||||
#if !defined(QT_NO_SYSTEMLOCALE) && defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY) \
|
||||
&& (!defined(Q_OS_DARWIN) || defined(Q_OS_NACL))
|
||||
#define TRANSIENT_ENV
|
||||
// Unix system locale consults environment variables, so we need to set
|
||||
|
Loading…
x
Reference in New Issue
Block a user