add vctest (WIP)

This commit is contained in:
MihailRis
2024-12-07 15:49:23 +03:00
parent d9bd60f473
commit 5e8805f241
16 changed files with 439 additions and 52 deletions
+15 -1
View File
@@ -36,6 +36,7 @@
#include "window/Events.hpp"
#include "window/input.hpp"
#include "window/Window.hpp"
#include "interfaces/Process.hpp"
#include <iostream>
#include <assert.h>
@@ -178,12 +179,25 @@ void Engine::saveScreenshot() {
void Engine::run() {
if (params.headless) {
logger.info() << "nothing to do";
runTest();
} else {
mainloop();
}
}
void Engine::runTest() {
if (params.testFile.empty()) {
logger.info() << "nothing to do";
return;
}
logger.info() << "starting test " << params.testFile;
auto process = scripting::start_coroutine(params.testFile);
while (process->isActive()) {
process->update();
}
logger.info() << "test finished";
}
void Engine::mainloop() {
logger.info() << "starting menu screen";
setScreen(std::make_shared<MenuScreen>(this));