mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-20 07:14:13 +02:00
599228fe6e
The test added with the #904 fix was run by hand. Register it so it runs with the rest of the suite, and fix two defects found while extending it to the element editor -- both of which made it report success it had not earned. nm -C "$BINARY" | grep -q <sym> under `set -o pipefail`: grep exits at the first match, nm dies of SIGPIPE, and the pipeline reports failure. The symbol check therefore skipped the test on every build that could actually run it. Read nm's output into a variable once and match with `case`. The input file was copied to a hardcoded "$SANDBOX/project.qet". QElectroTech picks the editor from the extension, so passing a .elmt gave a failed project load in the diagram editor rather than an element editor -- the run still found a dialog, still called quitQET(), and still reported a result, just for the wrong window. Preserve the basename. With that fixed, the element-editor path is exercised on its own: a read-only .elmt opens a message box, and on a build without the fix the run aborts with "double free or corruption" under ~QETElementEditor(), where before it named ~QETDiagramEditor(). The guard QETElementEditor calls from its closeEvent() covers a real crash, not a theoretical one. Registered on Linux only, and it reports 77 -- CTest's SKIP_RETURN_CODE -- when it cannot run at all: no gdb, a gdb built without Python, or a stripped binary whose QETApp symbols it cannot call. A release build that this test cannot drive is not a failing build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>