summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfile/tst_qfile.cpp
diff options
context:
space:
mode:
authorMarko Kangas <marko.kangas@theqtcompany.com>2015-02-13 13:01:57 +0200
committerMarko Kangas <marko.kangas@theqtcompany.com>2015-03-16 09:34:15 +0000
commitbc69fd1dfe30876909091d93a07640a498a24c0c (patch)
tree6af7b94832fcd5c596e54338266d43772ca152e6 /tests/auto/corelib/io/qfile/tst_qfile.cpp
parentf1b3244ac16cd5b306450c53fcbd4ee673bfe53b (diff)
Skip instead of entirely excluding tests with disabled features
Properly QSKIP tests that use disabled QProcess and symlink features instead of excluding them silently by #ifdef. Other reason is that moc doesn't respect QT_NO_* defines in class definition which causes build issues on some platforms. Change-Id: I041020f7452f7d36c7ec8a5866a4ba5eb23d1f94 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'tests/auto/corelib/io/qfile/tst_qfile.cpp')
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index a0609d67ac..98963108be 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -139,7 +139,7 @@ private slots:
void readAll_data();
void readAll();
void readAllBuffer();
-#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
+#if !defined(Q_OS_WINCE)
void readAllStdin();
void readLineStdin();
void readLineStdin_lineByLine();
@@ -868,9 +868,12 @@ void tst_QFile::readAllBuffer()
QFile::remove(fileName);
}
-#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
+#if !defined(Q_OS_WINCE)
void tst_QFile::readAllStdin()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QByteArray lotsOfData(1024, '@'); // 10 megs
QProcess process;
@@ -887,11 +890,14 @@ void tst_QFile::readAllStdin()
process.closeWriteChannel();
process.waitForFinished();
QCOMPARE(process.readAll().size(), lotsOfData.size() * 5);
+#endif
}
void tst_QFile::readLineStdin()
{
-
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QByteArray lotsOfData(1024, '@'); // 10 megs
for (int i = 0; i < lotsOfData.size(); ++i) {
if ((i % 32) == 31)
@@ -926,10 +932,14 @@ void tst_QFile::readLineStdin()
QCOMPARE(char(array[i]), char('0' + i % 32));
}
}
+#endif
}
void tst_QFile::readLineStdin_lineByLine()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
for (int i = 0; i < 2; ++i) {
QProcess process;
process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"),
@@ -949,6 +959,7 @@ void tst_QFile::readLineStdin_lineByLine()
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
}
+#endif
}
#endif