Skip to content

Add basic unit tests for MainWindow#1825

Draft
ddennedy wants to merge 3 commits into
masterfrom
unit-tests
Draft

Add basic unit tests for MainWindow#1825
ddennedy wants to merge 3 commits into
masterfrom
unit-tests

Conversation

@ddennedy
Copy link
Copy Markdown
Member

@ddennedy ddennedy commented May 9, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial CTest/QtTest-based harness to exercise basic MainWindow invariants, and refactors the build so the application’s compilation units can be reused by test executables.

Changes:

  • Introduces a QtTest-based TestMainWindow test binary and registers it with CTest (offscreen platform).
  • Adds a top-level tests/ CMake subtree and enables CTest integration.
  • Refactors src/CMakeLists.txt to build core sources as an OBJECT library (shotcut_objects) and links the shotcut executable (and tests) against it.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/mainwindow/mainwindowtest.cpp Adds QtTest cases covering basic MainWindow state, singleton access, action registration, and a profileChanged signal check.
tests/mainwindow/CMakeLists.txt Builds and registers test_mainwindow with CTest and sets QT_QPA_PLATFORM=offscreen.
tests/CMakeLists.txt Adds the mainwindow tests subdirectory.
src/CMakeLists.txt Splits app sources into shotcut_objects and links shotcut against it to enable reuse by tests.
CMakeLists.txt Enables testing and adds the tests/ subdirectory at the top level.

Comment thread CMakeLists.txt Outdated
Comment thread tests/mainwindow/mainwindowtest.cpp
Comment thread tests/mainwindow/mainwindowtest.cpp Outdated
Comment thread tests/mainwindow/mainwindowtest.cpp Outdated
ddennedy and others added 2 commits May 8, 2026 17:37
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants