1 #define CATCH_CONFIG_RUNNER
2 #include "catch.hpp"
3 
4 #include <QApplication>
5 #include <mlt++/MltFactory.h>
6 #include <mlt++/MltRepository.h>
7 #define private public
8 #define protected public
9 #include "core.h"
10 #include "mltconnection.h"
11 #include "src/effects/effectsrepository.hpp"
12 #include "src/mltcontroller/clipcontroller.h"
13 #include "bin/projectitemmodel.h"
14 /* This file is intended to remain empty.
15 Write your tests in a file with a name corresponding to what you're testing */
16 
main(int argc,char * argv[])17 int main(int argc, char *argv[])
18 {
19     QApplication app(argc, argv);
20     app.setApplicationName(QStringLiteral("kdenlive"));
21     std::unique_ptr<Mlt::Repository> repo(Mlt::Factory::init(nullptr));
22     qputenv("MLT_TESTS", QByteArray("1"));
23     Core::build(true);
24     MltConnection::construct(QString());
25     pCore->projectItemModel()->buildPlaylist();
26     // if Kdenlive is not installed, ensure we have one keyframable effect
27     EffectsRepository::get()->reloadCustom(QFileInfo("../data/effects/audiobalance.xml").absoluteFilePath());
28 
29     int result = Catch::Session().run(argc, argv);
30     ClipController::mediaUnavailable.reset();
31 
32     // global clean-up...
33     // delete repo;
34 
35     Core::m_self.reset();
36     Mlt::Factory::close();
37     return (result < 0xff ? result : 0xff);
38 }
39