2022-05-02 19:59:49 +02:00
|
|
|
#include "gmock/gmock.h"
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
|
|
#include "pythonrunner.h"
|
|
|
|
|
|
|
|
|
|
#include <QCoreApplication>
|
|
|
|
|
|
2025-05-29 11:03:51 +02:00
|
|
|
#include <uibase/iplugingame.h>
|
|
|
|
|
|
2022-05-02 19:59:49 +02:00
|
|
|
#include "MockOrganizer.h"
|
|
|
|
|
|
|
|
|
|
using namespace MOBase;
|
|
|
|
|
|
|
|
|
|
TEST(IPluginGame, Simple)
|
|
|
|
|
{
|
|
|
|
|
const auto plugins_folder = QString(std::getenv("PLUGIN_DIR"));
|
|
|
|
|
|
2022-05-06 17:40:11 +02:00
|
|
|
auto runner = mo2::python::createPythonRunner();
|
2022-05-02 19:59:49 +02:00
|
|
|
runner->initialize();
|
|
|
|
|
|
|
|
|
|
// load objects
|
|
|
|
|
const auto objects = runner->load(plugins_folder + "/dummy-game.py");
|
|
|
|
|
EXPECT_EQ(objects.size(), 1);
|
|
|
|
|
|
|
|
|
|
// load the IPlugin
|
|
|
|
|
IPluginGame* plugin = qobject_cast<IPluginGame*>(objects[0]);
|
|
|
|
|
EXPECT_NE(plugin, nullptr);
|
|
|
|
|
}
|