diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2008-07-30 21:14:24 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-07-29 08:50:20 (GMT) |
commit | d7b688870aead912690188b324d370b920a7a600 (patch) | |
tree | aac6c19d222ca3bad65cfbb850483a647013c67a /tests | |
parent | e5262a0c29c743f2afd4ba249e8adff984c1ca83 (diff) | |
download | Qt-d7b688870aead912690188b324d370b920a7a600.zip Qt-d7b688870aead912690188b324d370b920a7a600.tar.gz Qt-d7b688870aead912690188b324d370b920a7a600.tar.bz2 |
Port of Qt to VxWorks
This makes Qt work on VxWorks 6.6+ in native (kernel) mode.
* compiles with the WindRiver GNU toolchain (Linux only)
* works with QWS (tested with the VNC driver only)
* tested on PPC hardware and the x86 VxWorks simulator
* no q3support, no phonon, no webkit
* no QSharedMemory, no QSystemSemaphore, no QProcess
* only one QApplication instance (flat address space)
* filesystem support depends heavily on the quality of the native driver
* QLibrary is just a dummy to make plugins work at all
* qmake transparently creates VxWorks munching rules for static ctors
* made auto-test cope with missing OS features
A special note regarding the Q_FOREACH patch for dcc:
when calling foreach(a,c) with c being a function returning a container,
the compiler would generate 5 references to some labels (.LXXXX), which
are not there (so the linker complains in the end).
Seems like dcc doesn't really like the 'true ? 0 : <function call to get type>'
statement
Reviewed-By: Harald Fernengel
Diffstat (limited to 'tests')
23 files changed, 121 insertions, 49 deletions
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index e5b23ab..e900ed0 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -51,7 +51,9 @@ #include "../network-settings.h" - +#if defined(Q_OS_VXWORKS) +#define Q_NO_SYMLINKS +#endif //TESTED_CLASS= //TESTED_FILES= @@ -370,6 +372,20 @@ void tst_QDir::compare() QVERIFY(dir == QDir::currentPath()); } +static QStringList filterLinks(const QStringList &list) +{ +#ifndef Q_NO_SYMLINKS + return list; +#else + QStringList result; + foreach (QString str, list) { + if (!str.endsWith(QLatin1String(".lnk"))) + result.append(str); + } + return result; +#endif +} + void tst_QDir::entryList_data() { QTest::addColumn<QString>("dirName"); // relative from current path or abs @@ -411,94 +427,95 @@ void tst_QDir::entryList_data() QTest::newRow("nofilter") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::NoFilter) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::AllEntries") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::Files") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Files) << int(QDir::Name) - << QString("file,linktofile.lnk,writable").split(','); + << filterLinks(QString("file,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::Dirs") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Dirs) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk").split(',')); QTest::newRow("QDir::Dirs | QDir::NoDotAndDotDot") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Dirs | QDir::NoDotAndDotDot) << int(QDir::Name) - << QString("directory,linktodirectory.lnk").split(','); + << filterLinks(QString("directory,linktodirectory.lnk").split(',')); QTest::newRow("QDir::AllDirs") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllDirs) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk").split(',')); QTest::newRow("QDir::AllDirs | QDir::Dirs") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllDirs | QDir::Dirs) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk").split(',')); QTest::newRow("QDir::AllDirs | QDir::Files") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllDirs | QDir::Files) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::AllEntries | QDir::NoSymLinks") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::NoSymLinks) << int(QDir::Name) - << QString(".,..,directory,file,writable").split(','); + << filterLinks(QString(".,..,directory,file,writable").split(',')); QTest::newRow("QDir::AllEntries | QDir::NoSymLinks | QDir::NoDotAndDotDot") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::NoSymLinks | QDir::NoDotAndDotDot) << int(QDir::Name) - << QString("directory,file,writable").split(','); + << filterLinks(QString("directory,file,writable").split(',')); QTest::newRow("QDir::Files | QDir::NoSymLinks") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Files | QDir::NoSymLinks) << int(QDir::Name) - << QString("file,writable").split(','); + << filterLinks(QString("file,writable").split(',')); QTest::newRow("QDir::Dirs | QDir::NoSymLinks") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Dirs | QDir::NoSymLinks) << int(QDir::Name) - << QString(".,..,directory").split(','); + << filterLinks(QString(".,..,directory").split(',')); QTest::newRow("QDir::Drives | QDir::Files | QDir::NoDotAndDotDot") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Drives | QDir::Files | QDir::NoDotAndDotDot) << int(QDir::Name) - << QString("file,linktofile.lnk,writable").split(','); + << filterLinks(QString("file,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::System") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::System) << int(QDir::Name) - << QStringList("brokenlink.lnk"); + << filterLinks(QStringList("brokenlink.lnk")); QTest::newRow("QDir::Hidden") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Hidden) << int(QDir::Name) << QStringList(); QTest::newRow("QDir::System | QDir::Hidden") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::System | QDir::Hidden) << int(QDir::Name) - << QStringList("brokenlink.lnk"); + << filterLinks(QStringList("brokenlink.lnk")); QTest::newRow("QDir::AllDirs | QDir::NoSymLinks") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllDirs | QDir::NoSymLinks) << int(QDir::Name) - << QString(".,..,directory").split(','); + << filterLinks(QString(".,..,directory").split(',')); #ifdef QT3_SUPPORT QTest::newRow("QDir::All | QDir::Hidden | QDir::System") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::All | QDir::Hidden | QDir::System) << int(QDir::Name) - << QString(".,..,brokenlink.lnk,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,brokenlink.lnk,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::All | QDir::Readable") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::All | QDir::Readable) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::All | QDir::Writable") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::All | QDir::Writable) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk,writable").split(',')); #else QTest::newRow("QDir::AllEntries | QDir::Hidden | QDir::System") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::Hidden | QDir::System) << int(QDir::Name) - << QString(".,..,brokenlink.lnk,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,brokenlink.lnk,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::AllEntries | QDir::Readable") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::Readable) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::AllEntries | QDir::Writable") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::Writable) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk,writable").split(',')); #endif QTest::newRow("Namefilters b*") << SRCDIR "entrylist/" << QStringList("d*") << int(QDir::NoFilter) << int(QDir::Name) - << QString("directory").split(','); + << filterLinks(QString("directory").split(',')); QTest::newRow("Namefilters f*") << SRCDIR "entrylist/" << QStringList("f*") << int(QDir::NoFilter) << int(QDir::Name) - << QString("file").split(','); + << filterLinks(QString("file").split(',')); QTest::newRow("Namefilters link*") << SRCDIR "entrylist/" << QStringList("link*") << int(QDir::NoFilter) << int(QDir::Name) - << QString("linktodirectory.lnk,linktofile.lnk").split(','); + << filterLinks(QString("linktodirectory.lnk,linktofile.lnk").split(',')); QTest::newRow("Namefilters *to*") << SRCDIR "entrylist/" << QStringList("*to*") << int(QDir::NoFilter) << int(QDir::Name) - << QString("directory,linktodirectory.lnk,linktofile.lnk").split(','); + << filterLinks(QString("directory,linktodirectory.lnk,linktofile.lnk").split(',')); QTest::newRow("Sorting QDir::Name") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::NoFilter) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("Sorting QDir::Name | QDir::Reversed") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::NoFilter) << int(QDir::Name | QDir::Reversed) - << QString("writable,linktofile.lnk,linktodirectory.lnk,file,directory,..,.").split(','); + << filterLinks(QString("writable,linktofile.lnk,linktodirectory.lnk,file,directory,..,.").split(',')); + QTest::newRow("Sorting QDir::Type") << SRCDIR "types/" << QStringList("*") << int(QDir::NoFilter) << int(QDir::Type) << QString(".,..,a,b,c,d,e,f,a.a,b.a,c.a,d.a,e.a,f.a,a.b,b.b,c.b,d.b,e.b,f.b,a.c,b.c,c.c,d.c,e.c,f.c").split(','); @@ -635,6 +652,7 @@ void tst_QDir::entryListSimple() void tst_QDir::entryListWithSymLinks() { +#ifndef Q_NO_SYMLINKS QFile::remove("myLinkToDir.lnk"); QFile::remove("myLinkToFile.lnk"); QFile::remove("testfile.cpp"); @@ -667,6 +685,7 @@ void tst_QDir::entryListWithSymLinks() QFile::remove("myLinkToFile.lnk"); QFile::remove("testfile.cpp"); dir.rmdir("myDir"); +#endif } void tst_QDir::canonicalPath_data() diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp index 2d5758e..79e44d1 100644 --- a/tests/auto/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp @@ -48,6 +48,10 @@ #include <qfileinfo.h> #include <qstringlist.h> +#if defined(Q_OS_VXWORKS) +#define Q_NO_SYMLINKS +#endif + Q_DECLARE_METATYPE(QDirIterator::IteratorFlags) Q_DECLARE_METATYPE(QDir::Filters) @@ -87,6 +91,7 @@ tst_QDirIterator::tst_QDirIterator() QFile::remove("entrylist/directory/entrylist3.lnk"); QFile::remove("entrylist/directory/entrylist4.lnk"); +#ifndef Q_NO_SYMLINKS #ifdef Q_OS_WIN // ### Sadly, this is a platform difference right now. QFile::link("entrylist/file", "entrylist/linktofile.lnk"); @@ -97,6 +102,7 @@ tst_QDirIterator::tst_QDirIterator() QFile::link("directory", "entrylist/linktodirectory.lnk"); QFile::link("nothing", "entrylist/brokenlink.lnk"); #endif +#endif QFile("entrylist/writable").open(QIODevice::ReadWrite); } @@ -135,9 +141,13 @@ void tst_QDirIterator::iterateRelativeDirectory_data() "entrylist/..," #endif "entrylist/file," +#ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," +#endif "entrylist/directory," +#ifndef Q_NO_SYMLINKS "entrylist/linktodirectory.lnk," +#endif "entrylist/writable").split(','); QTest::newRow("QDir::Subdirectories | QDir::FollowSymlinks") @@ -151,10 +161,14 @@ void tst_QDirIterator::iterateRelativeDirectory_data() "entrylist/directory/..," #endif "entrylist/file," +#ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," +#endif "entrylist/directory," "entrylist/directory/dummy," +#ifndef Q_NO_SYMLINKS "entrylist/linktodirectory.lnk," +#endif "entrylist/writable").split(','); QTest::newRow("QDir::Subdirectories / QDir::Files") @@ -162,14 +176,18 @@ void tst_QDirIterator::iterateRelativeDirectory_data() << QDir::Filters(QDir::Files) << QStringList("*") << QString("entrylist/directory/dummy," "entrylist/file," +#ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," +#endif "entrylist/writable").split(','); QTest::newRow("QDir::Subdirectories | QDir::FollowSymlinks / QDir::Files") << QString("entrylist") << QDirIterator::IteratorFlags(QDirIterator::Subdirectories | QDirIterator::FollowSymlinks) << QDir::Filters(QDir::Files) << QStringList("*") << QString("entrylist/file," +#ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," +#endif "entrylist/directory/dummy," "entrylist/writable").split(','); } diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro index 89f3541..55f3b5c 100644 --- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro @@ -3,6 +3,8 @@ CONFIG += qttest_p4 include(../../src/qfiledialog.pri) include(../../../../modeltest/modeltest.pri) +QT = core gui + SOURCES += tst_qfilesystemmodel.cpp TARGET = tst_qfilesystemmodel diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro index 9186140..9c2f5cb 100644 --- a/tests/auto/qhttp/qhttp.pro +++ b/tests/auto/qhttp/qhttp.pro @@ -13,6 +13,8 @@ wince*: { addFiles.path = . DEPLOYMENT = addFiles webFiles cgi DEFINES += SRCDIR=\\\"\\\" +} else:vxworks*: { + DEFINES += SRCDIR=\\\"\\\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qline/qline.pro b/tests/auto/qline/qline.pro index ea15cfe..56718d0 100644 --- a/tests/auto/qline/qline.pro +++ b/tests/auto/qline/qline.pro @@ -1,6 +1,6 @@ load(qttest_p4) QT -= gui SOURCES += tst_qline.cpp -unix:!mac:LIBS+=-lm +unix:!mac:!vxworks:LIBS+=-lm diff --git a/tests/auto/qmetaobject/qmetaobject.pro b/tests/auto/qmetaobject/qmetaobject.pro index 22119bc..1df54f7 100644 --- a/tests/auto/qmetaobject/qmetaobject.pro +++ b/tests/auto/qmetaobject/qmetaobject.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT = core gui + SOURCES += tst_qmetaobject.cpp diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 788be1e..03b1474 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -2642,6 +2642,8 @@ void tst_QNetworkReply::ioPutToFileFromProcess() QCOMPARE(file.size(), qint64(data.size())); QByteArray contents = file.readAll(); QCOMPARE(contents, data); + + delete reply; #endif } diff --git a/tests/auto/qnumeric/tst_qnumeric.cpp b/tests/auto/qnumeric/tst_qnumeric.cpp index fb01e1b..0c83db4 100644 --- a/tests/auto/qnumeric/tst_qnumeric.cpp +++ b/tests/auto/qnumeric/tst_qnumeric.cpp @@ -41,6 +41,7 @@ #include <QtTest/QtTest> +#include <QtGlobal> #include <math.h> @@ -97,8 +98,12 @@ void tst_QNumeric::qNan() if (0 > nan) QFAIL("compiler thinks 0 > nan"); +# if defined(Q_CC_DIAB) + QWARN("!(0 < nan) would fail due to a bug in dcc"); +# else if (0 < nan) QFAIL("compiler thinks 0 < nan"); +# endif #endif QVERIFY(qIsNaN(nan)); QVERIFY(qIsNaN(nan + 1)); diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index 98c7a30..6684125 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -121,10 +121,10 @@ signals: private slots: void checkStopWatch() { -#ifndef Q_OS_WINCE - if (stopWatch.elapsed() >= OneMinute) -#else +#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) if (stopWatch.elapsed() >= OneMinute / 2) +#else + if (stopWatch.elapsed() >= OneMinute) #endif quit(); @@ -138,7 +138,7 @@ void tst_QObjectRace::moveToThreadRace() { RaceObject *object = new RaceObject; - enum { ThreadCount = 10 }; + enum { ThreadCount = 6 }; RaceThread *threads[ThreadCount]; for (int i = 0; i < ThreadCount; ++i) { threads[i] = new RaceThread; diff --git a/tests/auto/qreadwritelock/tst_qreadwritelock.cpp b/tests/auto/qreadwritelock/tst_qreadwritelock.cpp index 78ddc99..f298812 100644 --- a/tests/auto/qreadwritelock/tst_qreadwritelock.cpp +++ b/tests/auto/qreadwritelock/tst_qreadwritelock.cpp @@ -719,6 +719,8 @@ void tst_QReadWriteLock::multipleReadersLoop() int wait=0; #if defined (Q_OS_HPUX) const int numthreads=50; +#elif defined(Q_OS_VXWORKS) + const int numthreads=40; #else const int numthreads=75; #endif diff --git a/tests/auto/qregexp/qregexp.pro b/tests/auto/qregexp/qregexp.pro index 0712496..d467cda 100644 --- a/tests/auto/qregexp/qregexp.pro +++ b/tests/auto/qregexp/qregexp.pro @@ -2,6 +2,9 @@ load(qttest_p4) QT = core + +QT = core + SOURCES += tst_qregexp.cpp QT -= gui diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index cdbbbd2..8f3ca5c 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -15,6 +15,7 @@ runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runt QMAKE_EXTRA_TARGETS = runtime_resource ALL_DEPS += $${runtime_resource.target} +QT = core wince*:{ deploy.sources += runtime_resource.rcc parentdir.txt test.sources = testqrc/* diff --git a/tests/auto/qresourceengine/tst_resourceengine.cpp b/tests/auto/qresourceengine/tst_resourceengine.cpp index a5e701a..e133a72 100644 --- a/tests/auto/qresourceengine/tst_resourceengine.cpp +++ b/tests/auto/qresourceengine/tst_resourceengine.cpp @@ -108,7 +108,7 @@ void tst_ResourceEngine::checkStructure_data() << QLatin1String("runtime_resource") << QLatin1String("searchpath1") << QLatin1String("searchpath2") << QLatin1String("secondary_root") - << QLatin1String("test") << QLatin1String("trolltech") + << QLatin1String("test") << QLatin1String("withoutslashes")) << QLocale::c() << qlonglong(0); diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro index b5aa621..7c74b32 100644 --- a/tests/auto/qscriptengine/qscriptengine.pro +++ b/tests/auto/qscriptengine/qscriptengine.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT += script +QT = core gui script SOURCES += tst_qscriptengine.cpp DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/qscriptqobject/qscriptqobject.pro b/tests/auto/qscriptqobject/qscriptqobject.pro index e4e2b56..be3a980 100644 --- a/tests/auto/qscriptqobject/qscriptqobject.pro +++ b/tests/auto/qscriptqobject/qscriptqobject.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT += script +QT = core gui script SOURCES += tst_qscriptqobject.cpp diff --git a/tests/auto/qscriptvalue/qscriptvalue.pro b/tests/auto/qscriptvalue/qscriptvalue.pro index 98fd63d..9efde80 100644 --- a/tests/auto/qscriptvalue/qscriptvalue.pro +++ b/tests/auto/qscriptvalue/qscriptvalue.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT += script +QT = core gui script SOURCES += tst_qscriptvalue.cpp diff --git a/tests/auto/qstring/qstring.pro b/tests/auto/qstring/qstring.pro index 02253c2..eb52d90 100644 --- a/tests/auto/qstring/qstring.pro +++ b/tests/auto/qstring/qstring.pro @@ -1,8 +1,6 @@ load(qttest_p4) SOURCES += tst_qstring.cpp -QT -= gui - QT = core DEFINES += QT_NO_CAST_TO_ASCII diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro index 6924309..6a96889 100644 --- a/tests/auto/qtcpsocket/qtcpsocket.pro +++ b/tests/auto/qtcpsocket/qtcpsocket.pro @@ -3,3 +3,4 @@ TEMPLATE = subdirs !wince*: SUBDIRS = test stressTest wince*: SUBDIRS = test +vxworks*: SUBDIRS = test diff --git a/tests/auto/qtcpsocket/test/test.pro b/tests/auto/qtcpsocket/test/test.pro index fecbf11..696375d 100644 --- a/tests/auto/qtcpsocket/test/test.pro +++ b/tests/auto/qtcpsocket/test/test.pro @@ -9,6 +9,7 @@ wince*: { } } QT += network +vxworks:QT -= gui DEFINES += TEST_QNETWORK_PROXY diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 9e55764..6b0a5be 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -60,10 +60,12 @@ #include <QHostAddress> #include <QHostInfo> #include <QMap> +#ifndef Q_OS_VXWORKS #include <QMessageBox> +#include <QPushButton> +#endif #include <QPointer> #include <QProcess> -#include <QPushButton> #include <QStringList> #include <QTcpServer> #include <QTcpSocket> @@ -172,9 +174,7 @@ private slots: void connectToLocalHostNoService(); #endif void waitForConnectedInHostLookupSlot(); -#ifndef Q_OS_WIN void waitForConnectedInHostLookupSlot2(); -#endif void readyReadSignalsAfterWaitForReadyRead(); #ifdef Q_OS_LINUX void linuxKernelBugLocalSocket(); @@ -1573,6 +1573,7 @@ void tst_QTcpSocket::remoteCloseErrorSlot() void tst_QTcpSocket::messageBoxSlot() { +#if !defined(Q_OS_VXWORKS) // no gui QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender()); socket->deleteLater(); QMessageBox box; @@ -1583,10 +1584,14 @@ void tst_QTcpSocket::messageBoxSlot() // Fire a non-0 singleshot to leave time for the delete QTimer::singleShot(250, this, SLOT(exitLoopSlot())); +#endif } //---------------------------------------------------------------------------------- void tst_QTcpSocket::openMessageBoxInErrorSlot() { +#if defined(Q_OS_VXWORKS) // no gui + QSKIP("no default gui available on VxWorks", SkipAll); +#else QTcpSocket *socket = newSocket(); QPointer<QTcpSocket> p(socket); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(messageBoxSlot())); @@ -1594,6 +1599,7 @@ void tst_QTcpSocket::openMessageBoxInErrorSlot() socket->connectToHost("hostnotfoundhostnotfound.troll.no", 9999); // Host not found, fyi enterLoop(30); QVERIFY(!p); +#endif } //---------------------------------------------------------------------------------- @@ -1712,9 +1718,11 @@ public slots: }; //---------------------------------------------------------------------------------- -#ifndef Q_OS_WIN void tst_QTcpSocket::waitForConnectedInHostLookupSlot2() { +#if defined(Q_OS_WIN) || defined(Q_OS_VXWORKS) + QSKIP("waitForConnectedInHostLookupSlot2 is not run on Windows and VxWorks", SkipAll); +#else Foo foo; QPushButton top("Go", 0); @@ -1730,8 +1738,8 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot2() QVERIFY(foo.attemptedToConnect); QCOMPARE(foo.count, 1); -} #endif +} //---------------------------------------------------------------------------------- void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead() @@ -1965,7 +1973,7 @@ void tst_QTcpSocket::suddenRemoteDisconnect_data() void tst_QTcpSocket::suddenRemoteDisconnect() { -#if defined(Q_OS_WINCE) +#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) QSKIP("stressTest subprocess needs Qt3Support", SkipAll); #else QFETCH(QString, client); @@ -2022,6 +2030,9 @@ void tst_QTcpSocket::connectToMultiIP() { QSKIP("TODO: setup DNS in the new network", SkipAll); +#if defined(Q_OS_VXWORKS) + QSKIP("VxSim in standard config doesn't even run a DNS resolver", SkipAll); +#else QFETCH_GLOBAL(bool, ssl); if (ssl) return; @@ -2049,6 +2060,7 @@ void tst_QTcpSocket::connectToMultiIP() QCOMPARE(socket->error(), QAbstractSocket::SocketTimeoutError); delete socket; +#endif } //---------------------------------------------------------------------------------- diff --git a/tests/auto/qthreadonce/tst_qthreadonce.cpp b/tests/auto/qthreadonce/tst_qthreadonce.cpp index 590de0f..5d9062d 100644 --- a/tests/auto/qthreadonce/tst_qthreadonce.cpp +++ b/tests/auto/qthreadonce/tst_qthreadonce.cpp @@ -134,7 +134,7 @@ void tst_QThreadOnce::sameThread() void tst_QThreadOnce::multipleThreads() { -#ifdef Q_OS_WINCE +#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) const int NumberOfThreads = 20; #else const int NumberOfThreads = 100; diff --git a/tests/auto/qthreadpool/tst_qthreadpool.cpp b/tests/auto/qthreadpool/tst_qthreadpool.cpp index 1111ecc..d4c131d 100644 --- a/tests/auto/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/qthreadpool/tst_qthreadpool.cpp @@ -205,7 +205,8 @@ void tst_QThreadPool::runTask() ran = false; manager.start(new TestTask()); // Hang if task is not runned. - while (ran == false); + while (ran == false) + QTest::qSleep(100); // no busy loop - this doesn't work with FIFO schedulers } /* @@ -215,7 +216,8 @@ void tst_QThreadPool::singleton() { ran = false; QThreadPool::globalInstance()->start(new TestTask()); - while (ran == false); + while (ran == false) + QTest::qSleep(100); // no busy loop - this doesn't work with FIFO schedulers } int *value = 0; diff --git a/tests/auto/qxmlsimplereader/parser/main.cpp b/tests/auto/qxmlsimplereader/parser/main.cpp index 4834428..ffb2ecd 100644 --- a/tests/auto/qxmlsimplereader/parser/main.cpp +++ b/tests/auto/qxmlsimplereader/parser/main.cpp @@ -42,6 +42,7 @@ #include <string.h> #include <errno.h> +#include <stdlib.h> #include <qfile.h> #include <qstring.h> |