Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable covering more mscore code with automatic tests, add tests for workspaces editing #5448

Merged
merged 10 commits into from
Dec 16, 2019

Conversation

dmitrio95
Copy link
Contributor

@dmitrio95 dmitrio95 commented Nov 2, 2019

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:

  • It is not possible to link against mscore or include mscore/musescore.cpp to the list of files compiled in an automatic test due to the fact that mscore/musescore.cpp contains main() function which conflicts with main() function used by the test applications.
  • It is hard to initialize the main application classes (like Ms::MuseScore) properly: the existing main() function is overly complex.
  • Many parts of MuseScore code do not deinitialize properly relying on the fact that terminating the entire application would anyway release all the resources they hold.

This pull request tries to partially address these issues by decomposing the existing main() function and physically moving the function named main() out of mscore/ directory. Moving main() function enables mtests for linking with the entire mscore module which simplifies using the relevant classes (including MuseScore itself) in automatic tests. After decomposing the main() function and some (mostly minor) changes to mscore and libmscore 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.

 - Extract parseCommandLineArguments()
 - Extract initApplication()
 - Extract MuseScore::init()
 - Update and re-enable tests for QML-based plugins
 - Remove mtest-specific #define's in plugins API code
 - Make midimapping test compile
 - Convert mtest/test.mscx to MuseScore 3 file format
 - Remove unused files in mtest/
 - Improve ability to test mscoreapp in mtest framework
 - Expand testutils
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.

None yet

1 participant