MuseScore/mtest
Marc Sabatella b995287630 fix #294728: min distance not saved for lines unless offset changed too
If you move a line into the skyline (e.g, overlapping other elements),
we reduce the min distance automatically and save the result correctly.
But if you reduce the min distance manually via the Inspector
but don't change the offset, then save, the min distance is not written.
That is because we check if the line has been modified before writing these properties.
But we were only checking offset and offset2, not min distance.
This change adds that check.
2019-09-24 08:32:19 -06:00
..
biab fix #276978 crash during open .gpx file 2018-11-29 11:50:45 +01:00
bww/io update reference files for commit 389d24541d 2015-01-12 21:38:05 +01:00
capella Add single-note dynamics 2019-03-02 18:18:12 +00:00
guitarpro Add style settings for articulations placement 2019-06-10 17:54:06 +02:00
importmidi fix #294006: Symphony Orchestra template has wrong patches for pizzicato 2019-09-03 09:18:57 +02:00
libmscore fix #294728: min distance not saved for lines unless offset changed too 2019-09-24 08:32:19 -06:00
musicxml Merge pull request #4950 from lvinken/tuplet-calc-fractions-004 2019-08-26 09:38:59 +02:00
omr remove RCS IDs from (almost) all files 2018-11-02 23:53:21 +01:00
scripting Add changes from mattmcclinch to fix regression tests for musicxml and gtp import and scripting. 2019-02-18 11:48:24 +01:00
stringutils remove RCS IDs from (almost) all files 2018-11-02 23:53:21 +01:00
testoves remove RCS IDs from (almost) all files 2018-11-02 23:53:21 +01:00
testscript fix #280830: fix a crash on replacing a timesig with palette while in edit mode 2019-09-19 12:50:46 +02:00
zerberus remove RCS IDs from (almost) all files 2018-11-02 23:53:21 +01:00
build.xml Initial commit 2012-05-26 14:49:10 +02:00
cmake.inc Merge pull request #4143 from mirabilos/mtest-freetype 2019-04-22 20:09:03 +03:00
CMakeLists.txt Merge pull request #5293 from jthistle/293707-undo-no-restore-deleted-frame 2019-09-04 20:20:43 +02:00
config.h Fix build without SCRIPT_INTERFACE on Qt 5.7 2019-01-24 17:36:01 +03:00
mscoreapi.h Initial commit 2012-05-26 14:49:10 +02:00
mtest.cpp Add a test for checking read/write and reset/undo operations 2018-11-26 00:31:08 +02:00
mtest.qrc Fix #235526: Update musicxml to 3.1 2017-09-27 09:24:47 +02:00
openscore.h Initial commit 2012-05-26 14:49:10 +02:00
README.md fixed make test directions for linux, osx, win 2016-03-17 06:37:29 -04:00
test.mscx better bw. compatibility 2017-01-25 15:55:04 +01:00
testutils.cpp Replacd integer midi tick values by fractions. 2019-02-18 11:46:05 +01:00
testutils.h remove RCS IDs from (almost) all files 2018-11-02 23:53:21 +01:00
updateReferences.sh update Articulations in mtest/guitarpro source scores 2019-02-04 16:28:56 +02:00

Building & running the tests

To build all tests:

Linux OSX Windows
make debug
sudo make installdebug
cd build.debug/mtest
make
make -f Makefile.osx debug
make -f Makefile.osx installdebug
cd build.debug/mtest
make -f Makefile.osx
mingw32-make -f Makefile.mingw debug
mingw32-make -f Makefile.mingw installdebug
cd build.debug\mtest
mingw32-make -f Makefile.mingw

To run all tests:

ctest

To run only one test (for debugging purposes):

cd libmscore/join/
./tst_join

To see how the CI environment is doing it check .travis.yml and build/run_tests.sh

Note: You need to have diff in your path. For Windows, get a copy of diffutils for Windows.

Test case conventions

Tests are grouped in directories by feature (like libmscore or mxl). In these directories, each subdirectory represents a test suite for a particular sub feature.

The name of a test suite directory should be descriptive. The CPP file for the tests should use the same name as the directory, for example tst_foo.cpp in directory foo. It's good practice to include a README file in a test suite directory.

Test suite CPP files contain one slot per test case. Each file should be called foo-XX with XX being an incrementing count. If a test case uses a file and a ref file, they should be called foo-XX and foo-XX-ref, with the extension .mscx. A test case should not reuse a file from another test case.

To create reference or original files, MuseScore can be run with the -t command line argument and it will save all the files in the session in test mode. Such files do not contain platform or version information and do contain extra data for tracing (for example, they contains pixel level position for beams).

How to write a test case

Import test

  • Open a short file containing an individual case in one of the formats supported by MuseScore
  • Save in MuseScore format
  • Compare with reference file

At first the test will fail because there is no reference file. Open the file created by the test case in MuseScore and try to edit it to be sure it's valid. If the file is valid, save it (without version number) as a reference file.

Object read write

Create a test case for all elements and all properties in each element. See libmscore/note

  • Create an object
  • Set a property
  • Write and read the object
  • Check if the property has the right value

Action tests

See libmscore/join or libmscore/split for example

  • Read a score file
  • Apply an action
  • Write the file
  • Compare with a reference
  • (Undo the action)
  • (Compare with original file)

Compatibility tests

Most of them are in mtest/libmscore/compat

  • Read a score file from an older version of MuseScore
  • Write the file
  • Compare with a reference file