Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
653 B
C++
Raw Permalink Normal View History

2022-05-02 19:59:49 +02:00
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "pythonrunner.h"
#include <QCoreApplication>
2024-07-09 20:42:56 +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 = std::filesystem::path(std::getenv("PLUGIN_DIR"));
2022-05-02 19:59:49 +02:00
auto runner = mo2::python::createPythonRunner();
2022-05-02 19:59:49 +02:00
runner->initialize();
// load objects
const auto objects = runner->load("dummy_game", plugins_folder / "dummy-game.py");
2022-05-02 19:59:49 +02:00
EXPECT_EQ(objects.size(), 1);
// load the IPlugin
IPluginGame* plugin = qobject_cast<IPluginGame*>(objects[0][0]);
2022-05-02 19:59:49 +02:00
EXPECT_NE(plugin, nullptr);
}