Skip to content

Commit

Permalink
Skip StatusService::serviceDiscovered test on llvm-mingw
Browse files Browse the repository at this point in the history
Thanks to LLVM/Clang bug [#110975](
llvm/llvm-project#110975).
  • Loading branch information
pcolby committed Jan 7, 2025
1 parent 78812f6 commit 776df94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,11 @@ jobs:
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\lib
working-directory: ${{ runner.temp }}/release
# \todo Remove this step when https://github.com/llvm/llvm-project/issues/110975 is resolved.
- name: Test StatusService
if: matrix.toolchain == 'llvm'
shell: bash
run: |
/d/a/_temp/coverage/test/unit/lib/testStatusService.exe -o output.txt,txt || true
cat output.txt
run: /d/a/_temp/coverage/test/unit/lib/testStatusService.exe -o output,txt || :; cat output
- name: Test w/ coverage # We can't execute arm64 binaries on an x86-64 host.
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
run: ctest --output-on-failure --test-dir "%RUNNER_TEMP%/coverage" --verbose
Expand Down
32 changes: 8 additions & 24 deletions test/unit/lib/teststatusservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,30 +605,14 @@ void TestStatusService::serviceDiscovered()

// Pokit Meter's Status service UUId will be assigned.
service.d_func()->serviceDiscovered(StatusService::ServiceUuids::pokitMeter);

const QBluetoothUuid a = service.d_func()->serviceUuid;
QBluetoothUuid b = StatusService::ServiceUuids::pokitMeter;
const QUuid c = static_cast<QUuid>(a);
const QUuid d = static_cast<QUuid>(b);
qInfo() << a;
qInfo() << b;
qInfo() << StatusService::ServiceUuids::pokitMeter;
b = StatusService::ServiceUuids::pokitMeter;
qInfo() << b;
qInfo() << c;
qInfo() << d;
qInfo() << (a == b);
qInfo() << (c == d);
qInfo() << sizeof(a);
qInfo() << sizeof(b);
qInfo() << sizeof(c);
qInfo() << sizeof(d);
qInfo() << QByteArray((const char *)(&a), sizeof(a));
qInfo() << QByteArray((const char *)(&b), sizeof(b));
qInfo() << QByteArray((const char *)(&c), sizeof(c));
qInfo() << QByteArray((const char *)(&d), sizeof(d));
qInfo() << QTest::qCompare(a, b, "a", "b", "foo", 1);
qInfo() << QTest::qCompare(c, d, "c", "d", "foo", 2);
#if defined(Q_OS_WIN) && defined(Q_CC_CLANG)
qInfo() << "service.d_func()->serviceUuid" << service.d_func()->serviceUuid;
qInfo() << "StatusService::ServiceUuids::pokitMeter" << StatusService::ServiceUuids::pokitMeter;
qInfo() << "\\todo Once llvm-mingw is updated such that the above two match, then remove the following QSKIP()";
qInfo() << "\\todo See https://github.com/llvm/llvm-project/issues/110975";
QSKIP("LLVM has known 'const static inline variable initialisation' bug on Windows #110975");
#endif
QCOMPARE(service.d_func()->serviceUuid, StatusService::ServiceUuids::pokitMeter);

// Pokit Pro's Status service UUId will be assigned.
service.d_func()->serviceDiscovered(StatusService::ServiceUuids::pokitPro);
Expand Down

0 comments on commit 776df94

Please sign in to comment.