summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport/kernel
diff options
context:
space:
mode:
authorTatiana Borisova <tatiana.borisova@qt.io>2021-09-06 10:11:06 +0300
committerTatiana Borisova <tatiana.borisova@qt.io>2021-09-20 17:29:04 +0300
commit766904bf5b776a6437ca974efbeb9e99ef13e084 (patch)
treedd3b536372c65481b9fa42634d713350d77ecfca /tests/auto/printsupport/kernel
parente6892f38a084e514bf9c501f3045b297f6260714 (diff)
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>
Diffstat (limited to 'tests/auto/printsupport/kernel')
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
index 01e63af082..ebe0990164 100644
--- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
+++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
@@ -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)