From 2d3ce63b54af6b85597be24213cbc1411f3a9996 Mon Sep 17 00:00:00 2001 From: IChooseYou Date: Fri, 20 Feb 2026 07:27:23 -0700 Subject: [PATCH] ci: disable UI tests in CI, delete test_com_security MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI now passes -DBUILD_UI_TESTS=OFF so only headless tests (core, format, compose, provider, command_row, generator, import_xml, import_source, export_xml, disasm) build and run. Removed xvfb-run and exclude-regex hacks from both Windows and Linux CI — the CMake option handles it cleanly. Deleted test_com_security (windbg-only, not needed in CI). --- .github/workflows/build.yml | 10 +- CMakeLists.txt | 8 -- tests/test_com_security.cpp | 185 ------------------------------------ 3 files changed, 4 insertions(+), 199 deletions(-) delete mode 100644 tests/test_com_security.cpp diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 440eaf9..cb79492 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,13 +31,13 @@ jobs: arch: x64 - name: Configure - run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_UI_TESTS=OFF - name: Build run: cmake --build build - name: Test - run: ctest --test-dir build --output-on-failure --exclude-regex "test_editor|test_controller|test_windbg_provider|test_com_security" + run: ctest --test-dir build --output-on-failure - name: Upload artifact uses: actions/upload-artifact@v4 @@ -118,15 +118,13 @@ jobs: sudo apt-get install -y ninja-build libgl1-mesa-dev libfuse2 libxcb-cursor0 - name: Configure - run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_UI_TESTS=OFF - name: Build run: cmake --build build - name: Test - run: xvfb-run ctest --test-dir build --output-on-failure --exclude-regex "test_editor|test_controller" - env: - QT_QPA_PLATFORM: offscreen + run: ctest --test-dir build --output-on-failure - name: Create AppImage run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index c6e5477..bb83d6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -345,14 +345,6 @@ if(BUILD_TESTING) add_test(NAME test_windbg_provider COMMAND test_windbg_provider) endif() - # Standalone test: proves whether CoInitializeSecurity is needed for DebugConnect - # Requires a running WinDbg debug server on port 5055 - if(WIN32) - add_executable(test_com_security tests/test_com_security.cpp) - target_link_libraries(test_com_security PRIVATE dbgeng ole32 version) - add_test(NAME test_com_security COMMAND test_com_security) - endif() - # Deploy Qt runtime DLLs for tests (run windeployqt on a representative test exe # that links the broadest set of Qt modules; all test exes share the same output dir) if(TARGET ${QT}::windeployqt) diff --git a/tests/test_com_security.cpp b/tests/test_com_security.cpp deleted file mode 100644 index a76b08d..0000000 --- a/tests/test_com_security.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/** - * test_com_security.cpp — DebugConnect transport diagnostic - * - * Tests EVERY transport to find what works from MinGW: - * 1. TCP to WinDbg .server (port 5055) - * 2. Named pipe to WinDbg .server - * 3. TCP with various COM security configs - * 4. DebugCreate local (baseline) - * - * SETUP: In WinDbg, run BOTH of these: - * .server tcp:port=5055 - * .server npipe:pipe=reclass - * - * Then run this test. - */ - -#include -#include -#include - -#ifdef _WIN32 -#include -#include -#include -#include -#endif - -#ifdef _WIN32 -static void try_connect(const char* label, const char* connStr) -{ - printf(" %-40s → ", label); - fflush(stdout); - - IDebugClient* client = nullptr; - HRESULT hr = DebugConnect(connStr, IID_IDebugClient, (void**)&client); - - if (SUCCEEDED(hr) && client) { - printf("SUCCESS (hr=0x%08lX)\n", (unsigned long)hr); - - // Try to get data spaces and read something - IDebugDataSpaces* ds = nullptr; - IDebugSymbols* sym = nullptr; - IDebugControl* ctrl = nullptr; - client->QueryInterface(IID_IDebugDataSpaces, (void**)&ds); - client->QueryInterface(IID_IDebugSymbols, (void**)&sym); - client->QueryInterface(IID_IDebugControl, (void**)&ctrl); - - if (ctrl) { - HRESULT hrWait = ctrl->WaitForEvent(0, 5000); - printf(" WaitForEvent: hr=0x%08lX\n", (unsigned long)hrWait); - } - - if (sym) { - ULONG numMods = 0, numUnloaded = 0; - sym->GetNumberModules(&numMods, &numUnloaded); - printf(" Modules: %lu loaded\n", numMods); - - if (numMods > 0 && ds) { - ULONG64 base = 0; - sym->GetModuleByIndex(0, &base); - unsigned char buf[2] = {}; - ULONG got = 0; - ds->ReadVirtual(base, buf, 2, &got); - printf(" Read at 0x%llX: got=%lu bytes=[%02X %02X]\n", - (unsigned long long)base, got, buf[0], buf[1]); - } - } - - if (sym) sym->Release(); - if (ds) ds->Release(); - if (ctrl) ctrl->Release(); - client->Release(); - } else { - char buf[256] = {}; - FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - nullptr, (DWORD)hr, 0, buf, sizeof(buf), nullptr); - for (char* p = buf + strlen(buf) - 1; p >= buf && (*p == '\r' || *p == '\n'); --p) - *p = '\0'; - printf("FAIL hr=0x%08lX (%s)\n", (unsigned long)hr, buf); - } -} -#endif - -int main() -{ -#ifdef _WIN32 - char hostname[256] = {}; - DWORD hsize = sizeof(hostname); - GetComputerNameA(hostname, &hsize); - - printf("=== DebugConnect Transport Diagnostic ===\n"); - printf("Machine: %s\n\n", hostname); - - // ── Baseline: DebugCreate (local) ── - printf("[1] DebugCreate (local, no network)\n"); - { - IDebugClient* client = nullptr; - HRESULT hr = DebugCreate(IID_IDebugClient, (void**)&client); - printf(" DebugCreate: %s (hr=0x%08lX)\n\n", - SUCCEEDED(hr) ? "OK" : "FAIL", (unsigned long)hr); - if (client) client->Release(); - } - - // ── TCP variants ── - printf("[2] TCP connections (need: .server tcp:port=5055)\n"); - try_connect("tcp:Port=5055,Server=localhost", - "tcp:Port=5055,Server=localhost"); - try_connect("tcp:Port=5055,Server=127.0.0.1", - "tcp:Port=5055,Server=127.0.0.1"); - { - char conn[512]; - snprintf(conn, sizeof(conn), "tcp:Port=5055,Server=%s", hostname); - try_connect(conn, conn); - } - printf("\n"); - - // ── Named pipe variants ── - printf("[3] Named pipe connections (need: .server npipe:pipe=reclass)\n"); - try_connect("npipe:Pipe=reclass,Server=localhost", - "npipe:Pipe=reclass,Server=localhost"); - { - char conn[512]; - snprintf(conn, sizeof(conn), "npipe:Pipe=reclass,Server=%s", hostname); - try_connect(conn, conn); - } - try_connect("npipe:Pipe=reclass", - "npipe:Pipe=reclass"); - printf("\n"); - - // ── TCP with COM security ── - printf("[4] TCP with explicit COM init (MTA + IMPERSONATE)\n"); - { - // This runs in-process so CoInitialize affects subsequent calls - CoInitializeEx(nullptr, COINIT_MULTITHREADED); - CoInitializeSecurity( - nullptr, -1, nullptr, nullptr, - RPC_C_AUTHN_LEVEL_DEFAULT, - RPC_C_IMP_LEVEL_IMPERSONATE, - nullptr, EOAC_NONE, nullptr); - try_connect("tcp:Port=5055,Server=localhost (MTA+SEC)", - "tcp:Port=5055,Server=localhost"); - try_connect("npipe:Pipe=reclass (MTA+SEC)", - "npipe:Pipe=reclass,Server=localhost"); - CoUninitialize(); - } - printf("\n"); - - // ── Check if dbgeng.dll is the system one ── - printf("[5] DbgEng DLL info\n"); - { - HMODULE hmod = GetModuleHandleA("dbgeng.dll"); - if (hmod) { - char path[MAX_PATH] = {}; - GetModuleFileNameA(hmod, path, MAX_PATH); - printf(" dbgeng.dll loaded from: %s\n", path); - - // Get version - DWORD verSize = GetFileVersionInfoSizeA(path, nullptr); - if (verSize > 0) { - auto* verData = (char*)malloc(verSize); - if (GetFileVersionInfoA(path, 0, verSize, verData)) { - VS_FIXEDFILEINFO* fileInfo = nullptr; - UINT len = 0; - if (VerQueryValueA(verData, "\\", (void**)&fileInfo, &len)) { - printf(" Version: %d.%d.%d.%d\n", - HIWORD(fileInfo->dwFileVersionMS), - LOWORD(fileInfo->dwFileVersionMS), - HIWORD(fileInfo->dwFileVersionLS), - LOWORD(fileInfo->dwFileVersionLS)); - } - } - free(verData); - } - } else { - printf(" dbgeng.dll not loaded yet\n"); - } - } - - printf("\n=== Done ===\n"); - return 0; -#else - printf("Windows only.\n"); - return 0; -#endif -}