mtest doesn't work on Windows (master)

• May 12, 2018 - 15:18
Reported version
3.0
Type
Functional
Severity
S3 - Major
Status
closed
Project

The first thing is incorrect instructions for Windows: to run making test the following command must be run mingw32-make.exe -f Makefile.

Then, the following error appears:

C:\work\MuseScore3\mtest\libmscore\note\tst_note.cpp: In member function 'void TestNote::LongNoteAfterShort_183746()':
C:\work\MuseScore3\mtest\libmscore\note\tst_note.cpp:537:39: error: reference to 'Chord' is ambiguous
             totalTicks += static_cast(n->parent())->durationTypeTicks();
                                       ^
In file included from C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/windows.h:71:0,
                 from C:/Qt/5.9.4/mingw53_32/include/QtCore/qt_windows.h:64,
                 from C:/Qt/5.9.4/mingw53_32/include/QtGui/qopengl.h:49,
                 from C:/Qt/5.9.4/mingw53_32/include/QtGui/QtGui:43,
                 from all.h:45:
C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/wingdi.h:2681:28: note: candidates are: WINBOOL Chord(HDC, int, int, int, int, int, int, int, int)
   WINGDIAPI WINBOOL WINAPI Chord(HDC hdc,int x1,int y1,int x2,int y2,int x3,int y3,int x4,int y4);
                            ^
In file included from C:\work\MuseScore3\mtest\libmscore\note\tst_note.cpp:21:0:
C:/work/MuseScore3/libmscore/chord.h:61:7: note:                 class Ms::Chord
 class Chord final : public ChordRest {
       ^

It seems like Chord definition inteferes with some of Windows definitions.


Comments

In reply to by Anatoly-os

Just adding target mtest to the cmake config in QtCreator (cmake.exe --build . --target mtest) doesn't show any error, it builds mtest.exe cleanly. It doesn't run or builds any tests though

cmake.exe --build . --target tst_note though gives the error you describe

How to build and run the mtests under QtCtreator?

The tst_biab fail seems to be due to:

<metaTag name="originalFormat">sgu</metaTag>

Which looks like a legitimate fail, seems the ref file needs to get updated.
Not sure why this passes on Linux / Travis?

(running MuseScore.exe with the -t option)

The wrong instructions you refer to are in ...mtest/Readme.md, right? So they should be fixed there.

To run all tests is say to run ctest, but there is no such such file?

I don't know how to do it in QtCreator. Maybe a "test" target should be added to the Makefile.
I run the tests via command line, by using:
cd build.debug\mtest
mingw32-make -j4

and then running ctest (which is part of cmake; actually the command I run is "ctest -j4 --output-on-failure"). I found that win32install\bin folder should also be in the PATH because some of the dlls (e.g. libsndfile-1.dll) are required by the sfz tests.
Attached the results of ctest. The failure in biab tests is due to the "name" tag of Harmony objects.
There is also a difference in one binary midi output file of tst_midi.
The info about missing chords_std.xml for some of the tests is printed when directly running mtest.exe (which performs only some of the tests).

Attachment Size
testlog3.txt 16.33 KB

Indeed, as I recall last time I tried building & running tests myself (about three systems ago), you needed to manually create enough of an environment for some tests to run successfully. And missing chords_std.xml would likely cause failures in tests dealing with chord symbols.