File indexing completed on 2025-02-16 04:32:22
0001 /* 0002 SPDX-FileCopyrightText: 2018-2022 Jean-Baptiste Mardelle <jb@kdenlive.org> 0003 SPDX-FileCopyrightText: 2017-2019 Nicolas Carion <french.ebook.lover@gmail.com> 0004 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 #define CATCH_CONFIG_RUNNER 0007 #include "catch.hpp" 0008 0009 #include <QApplication> 0010 #include <mlt++/MltFactory.h> 0011 #include <mlt++/MltRepository.h> 0012 #define private public 0013 #define protected public 0014 #include "bin/projectitemmodel.h" 0015 #include "core.h" 0016 #include "mltconnection.h" 0017 #include "src/effects/effectsrepository.hpp" 0018 #include "src/mltcontroller/clipcontroller.h" 0019 0020 /* This file is intended to remain empty. 0021 Write your tests in a file with a name corresponding to what you're testing */ 0022 0023 int main(int argc, char *argv[]) 0024 { 0025 qSetGlobalQHashSeed(0); 0026 QApplication app(argc, argv); 0027 app.setApplicationName(QStringLiteral("kdenlive")); 0028 std::unique_ptr<Mlt::Repository> repo(Mlt::Factory::init(nullptr)); 0029 qputenv("MLT_TESTS", QByteArray("1")); 0030 qSetMessagePattern(QStringLiteral("%{time hh:mm:ss.zzz } %{file}:%{line} -- %{message}")); 0031 Core::build(QString(), true); 0032 MltConnection::construct(QString()); 0033 pCore->projectItemModel()->buildPlaylist(QUuid()); 0034 // if Kdenlive is not installed, ensure we have one keyframable effect 0035 EffectsRepository::get()->reloadCustom(QFileInfo("../data/effects/audiobalance.xml").absoluteFilePath()); 0036 0037 int result = Catch::Session().run(argc, argv); 0038 pCore->cleanup(); 0039 ClipController::mediaUnavailable.reset(); 0040 0041 // global clean-up... 0042 // delete repo; 0043 pCore->projectItemModel()->clean(); 0044 // Mlt::Factory::close(); 0045 Core::m_self.reset(); 0046 return (result < 0xff ? result : 0xff); 0047 }