Enable covering more mscore code with automatic tests, add tests for workspaces editing #5448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing mtest framework is not currently able to cover most of the code in
mscore/
directory by automatic tests. There are three main reasons for that:mscore
or includemscore/musescore.cpp
to the list of files compiled in an automatic test due to the fact thatmscore/musescore.cpp
containsmain()
function which conflicts withmain()
function used by the test applications.Ms::MuseScore
) properly: the existingmain()
function is overly complex.This pull request tries to partially address these issues by decomposing the existing
main()
function and physically moving the function namedmain()
out ofmscore/
directory. Movingmain()
function enables mtests for linking with the entiremscore
module which simplifies using the relevant classes (includingMuseScore
itself) in automatic tests. After decomposing themain()
function and some (mostly minor) changes tomscore
andlibmscore
themselves it has also became possible to initialize and deinitialize certain parts of MuseScore application-level objects without relaunching the entire program. This enables using them in automatic tests so more code becomes potentially testable.This PR applies these capabilities to restore (very minimal) automatic tests for QML plugins and add automatic tests for some operations related to workspaces editing. While writing these tests certain issues were found, the related tests are skipped or marked as "expected failure" in this pull request.
This PR's changes have not been however tested yet on all platforms so certain changes to build scripts are possible.