Skip to content

Commit

Permalink
sync mtest from 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkorsukov authored and vpereverzev committed Feb 16, 2021
1 parent 747cd4a commit b1560a7
Show file tree
Hide file tree
Showing 650 changed files with 7,327 additions and 3,492 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if (BUILD_UNIT_TESTS)
add_subdirectory(userscores/tests)

# needs actualization
# add_subdirectory(libmscore/tests)
add_subdirectory(libmscore/tests)
# add_subdirectory(importexport/bb/tests)
# add_subdirectory(importexport/braille/tests)
# add_subdirectory(importexport/bww/tests)
Expand Down
1 change: 1 addition & 0 deletions src/framework/fonts/fonts_Leland.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<qresource prefix="/">
<file alias="fonts/leland/Leland.otf">../../../fonts/leland/Leland.otf</file>
<file alias="fonts/leland/LelandText.otf">../../../fonts/leland/LelandText.otf</file>
<file alias="fonts/leland/metadata.json">../../../fonts/leland/metadata.json</file>
</qresource>
</RCC>
3 changes: 3 additions & 0 deletions src/framework/testing/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "environment.h"

#include "framework/global/globalmodule.h"
#include "framework/system/systemmodule.h"

using namespace mu::testing;

Expand Down Expand Up @@ -55,6 +56,8 @@ void Environment::setup()

//! NOTE Now we can use logger and profiler

m_dependencyModules.push_back(new mu::system::SystemModule());

for (mu::framework::IModuleSetup* m : m_dependencyModules) {
m->registerResources();
}
Expand Down
1 change: 1 addition & 0 deletions src/framework/testing/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ target_link_libraries(${MODULE_TEST}
Qt5::Gui
gmock
global
system
${MODULE_TEST_LINK}
)

Expand Down
1 change: 1 addition & 0 deletions src/framework/testing/qtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ target_link_libraries(${MODULE_TEST}
Qt5::Widgets
Qt5::Test
global
system
${MODULE_TEST_LINK}
)

Expand Down
5 changes: 5 additions & 0 deletions src/framework/testing/qtestsuite.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef MU_TESTING_QTESTSUITE_H
#define MU_TESTING_QTESTSUITE_H

#include <QDebug>
#include <QtTest/QtTest>
#include <QList>

Expand Down Expand Up @@ -65,6 +66,10 @@ class QTestSuite
inline static int run(int argc, char* argv[])
{
//! TODO Add filter by the test function
qDebug() << "========================== argc: " << argc;
for (int i = 0; i < argc; ++i) {
qDebug() << "========================== argv " << i << ": " << argv[i];
}
int ret = 0;
for (QObject* test : testList()) {
ret += QTest::qExec(test, argc, argv);
Expand Down
5 changes: 4 additions & 1 deletion src/framework/uicomponents/uicomponentsmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@ void UiComponentsModule::registerUiTypes()

qmlRegisterType<PopupView>("MuseScore.UiComponents", 1, 0, "PopupView");

framework::ioc()->resolve<ui::IUiEngine>(moduleName())->addSourceImportPath(uicomponents_QML_IMPORT);
auto ui = framework::ioc()->resolve<ui::IUiEngine>(moduleName());
if (ui) {
ui->addSourceImportPath(uicomponents_QML_IMPORT);
}
}
2 changes: 1 addition & 1 deletion src/importexport/bb/tests/testbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ void MTest::initMTest(const QString& rootDir)
mscore->init();

root = rootDir;
loadInstrumentTemplates(":/instruments.xml");
loadInstrumentTemplates(":/data/instruments.xml");
}
}
2 changes: 1 addition & 1 deletion src/importexport/braille/tests/testbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ void MTest::initMTest(const QString& rootDir)
mscore->init();

root = rootDir;
loadInstrumentTemplates(":/instruments.xml");
loadInstrumentTemplates(":/data/instruments.xml");
}
}
2 changes: 1 addition & 1 deletion src/importexport/bww/tests/testbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ void MTest::initMTest(const QString& rootDir)
mscore->init();

root = rootDir;
loadInstrumentTemplates(":/instruments.xml");
loadInstrumentTemplates(":/data/instruments.xml");
}
}
2 changes: 1 addition & 1 deletion src/importexport/capella/tests/testbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ void MTest::initMTest(const QString& rootDir)
mscore->init();

root = rootDir;
loadInstrumentTemplates(":/instruments.xml");
loadInstrumentTemplates(":/data/instruments.xml");
}
}
2 changes: 1 addition & 1 deletion src/importexport/midiimport/tests/testbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ void MTest::initMTest(const QString& rootDir)
mscore->init();

root = rootDir;
loadInstrumentTemplates(":/instruments.xml");
loadInstrumentTemplates(":/data/instruments.xml");
}
}
2 changes: 1 addition & 1 deletion src/importexport/musicxml/tests/testbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,6 @@ void MTest::initMTest(const QString& rootDir)
mscore->init();

root = rootDir;
loadInstrumentTemplates(":/instruments.xml");
loadInstrumentTemplates(":/data/instruments.xml");
}
}
19 changes: 12 additions & 7 deletions src/libmscore/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@ set(MODULE_TEST_SRC
${CMAKE_CURRENT_LIST_DIR}/tst_dynamic.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_earlymusic.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_element.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_exchangevoices.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_exchangevoices.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_hairpin.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_implodeExplode.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_instrumentchange.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_join.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_keysig.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_keysig.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_layout_benchmark.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_links.cpp # fail
${CMAKE_CURRENT_LIST_DIR}/tst_measure.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_measure.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_midi.cpp not ported
# ${CMAKE_CURRENT_LIST_DIR}/tst_midimapping.cpp not ported
${CMAKE_CURRENT_LIST_DIR}/tst_note.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_parts.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_parts.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_readwriteundoreset.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_remove.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_repeat.cpp # fail
${CMAKE_CURRENT_LIST_DIR}/tst_rhythmicGrouping.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_selectionfilter.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_selectionfilter.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_selectionrangedelete.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_spanners.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_split.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_spanners.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_split.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_splitstaff.cpp
# ${CMAKE_CURRENT_LIST_DIR}/tst_text.cpp not actual, not compile
${CMAKE_CURRENT_LIST_DIR}/tst_timesig.cpp
Expand All @@ -76,6 +76,11 @@ set(MODULE_TEST_LINK
qzip
libmscore
fonts
# ui
# actions
# notation
instruments
uicomponents
)

set(MODULE_TEST_DATA_ROOT ${CMAKE_CURRENT_LIST_DIR})
Expand Down
5 changes: 3 additions & 2 deletions src/libmscore/tests/barline_data/barlinedelete-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="3.01">
<museScore version="3.02">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down Expand Up @@ -30,14 +30,15 @@
</StaffType>
</Staff>
<trackName>Piano</trackName>
<Instrument>
<Instrument id="piano">
<longName>Piano</longName>
<shortName>Pno.</shortName>
<trackName>Piano</trackName>
<minPitchP>21</minPitchP>
<maxPitchP>108</maxPitchP>
<minPitchA>21</minPitchA>
<maxPitchA>108</maxPitchA>
<instrumentId>keyboard.piano</instrumentId>
<clef staff="2">F</clef>
<Articulation>
<velocity>100</velocity>
Expand Down
Loading

0 comments on commit b1560a7

Please sign in to comment.