Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/Test/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## Test
Test plugin project used in automatic builds for verification of generated PluginSDK binaries.
Test plugin project is used in automatic builds for verification of generated PluginSDK binaries.
2 changes: 2 additions & 0 deletions examples/UnitTests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Unit Tests
Plugin hosting and running Unit Tests.
40 changes: 40 additions & 0 deletions examples/UnitTests/source/Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <plugin.h>
#include "utest.h"
#include "Test_CVector.h"

using namespace plugin;

UTEST_STATE();

struct Main
{
Main()
{
gInstance.RunTests(); // run now. In future some tests might require the game to be initialized
// register event callbacks
//Events::menuDrawingEvent += []{ gInstance.RunTests(); };
}

void RunTests()
{
// just once
static bool ran = false;
if (ran) return;
ran = true;

if(AllocConsole())
{
SetWindowText(GetConsoleWindow(), "Plugin-SDK Unit Tests");
//RemoveMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_BYCOMMAND);

// redirect output into new console
FILE* fDummy;
freopen_s(&fDummy, "CONOUT$", "w", stdout);
std::cout.clear();
std::clog.clear();
}

utest_main(__argc, __argv);
}
} gInstance;

Loading