Handle VxWorks in QFileSelector

QFileSelector tests fail, because VxWorks is not properly categorized.
Even though it is not a unix-like system, it does provide a
compatibility layer that enables some unix utilities.
It has also been treated as unix on the Qt 5 customer branch.

Solve the issue by assigning VxWorks to the unix category in
QFileSelector and its tests

Task-number: QTBUG-115777
Pick-to: 6.7 6.8
Change-Id: Icab80764b66b121995f51ddf149de55dc8c9eb55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Łukasz Matysiak 2024-06-17 17:24:10 +02:00 committed by Michał Łoś
parent 65b5debe3a
commit da5de2926a
6 changed files with 6 additions and 2 deletions

View File

@ -318,8 +318,9 @@ QStringList QFileSelectorPrivate::platformSelectors()
ret << QSysInfo::kernelType(); // "winnt" ret << QSysInfo::kernelType(); // "winnt"
#elif defined(Q_OS_UNIX) #elif defined(Q_OS_UNIX)
ret << QStringLiteral("unix"); ret << QStringLiteral("unix");
# if !defined(Q_OS_ANDROID) && !defined(Q_OS_QNX) # if !defined(Q_OS_ANDROID) && !defined(Q_OS_QNX) && !defined(Q_OS_VXWORKS)
// we don't want "linux" for Android or two instances of "qnx" for QNX // we don't want "linux" for Android or two instances of "qnx" for QNX
// or two instances of "vxworks" for vxworks
ret << QSysInfo::kernelType(); ret << QSysInfo::kernelType();
# endif # endif
QString productName = QSysInfo::productType(); QString productName = QSysInfo::productType();

View File

@ -47,8 +47,11 @@ set(qfileselector_resource_files
"platforms/+unix/+haiku/test" "platforms/+unix/+haiku/test"
"platforms/+unix/+linux/test" "platforms/+unix/+linux/test"
"platforms/+unix/+qnx/test" "platforms/+unix/+qnx/test"
"platforms/+unix/+vxworks/test"
"platforms/+unix/test" "platforms/+unix/test"
"platforms/+unix/test3" "platforms/+unix/test3"
"platforms/+vxworks/test"
"platforms/+vxworks/test2"
"platforms/+wince/test" "platforms/+wince/test"
"platforms/+wince/test2" "platforms/+wince/test2"
"platforms/+windows/+wince/test" "platforms/+windows/+wince/test"

View File

@ -61,7 +61,7 @@ void tst_QFileSelector::basicTest_data()
QString expectedPlatform2File(""); //Only the last selector QString expectedPlatform2File(""); //Only the last selector
QString expectedPlatform3File; // Only the first selector (the family) QString expectedPlatform3File; // Only the first selector (the family)
#if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_WASM) && \ #if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_WASM) && \
!defined(Q_OS_DARWIN) && !defined(Q_OS_LINUX) && !defined(Q_OS_HAIKU) && !defined(Q_OS_QNX) !defined(Q_OS_DARWIN) && !defined(Q_OS_LINUX) && !defined(Q_OS_HAIKU) && !defined(Q_OS_QNX) && !defined(Q_OS_VXWORKS)
/* We are only aware of specific unixes, and do not have test files for any of the others. /* We are only aware of specific unixes, and do not have test files for any of the others.
However those unixes can get a selector added from the result of a uname call, so this will However those unixes can get a selector added from the result of a uname call, so this will
lead to a case where we don't have that file so we can't expect the concatenation of platform lead to a case where we don't have that file so we can't expect the concatenation of platform