mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 23:01:56 -04:00
Create new categorized test classes, for the most part just a copy of current tests into new framework
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "game/runtime.h"
|
||||
#include "goalc/listener/Listener.h"
|
||||
#include "goalc/compiler/Compiler.h"
|
||||
|
||||
#include "third-party/inja.hpp"
|
||||
#include "third-party/json.hpp"
|
||||
#include <common\util\FileUtil.h>
|
||||
|
||||
#include <test\goalc\framework\test_runner.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <filesystem>
|
||||
|
||||
struct PointerParam {
|
||||
// TODO - Not Needed Yet
|
||||
};
|
||||
|
||||
class PointerTests : public testing::TestWithParam<PointerParam> {
|
||||
public:
|
||||
static void SetUpTestSuite() {
|
||||
runtime_thread = std::thread((GoalTest::runtime_no_kernel));
|
||||
runner.c = &compiler;
|
||||
}
|
||||
|
||||
static void TearDownTestSuite() {
|
||||
compiler.shutdown_target();
|
||||
runtime_thread.join();
|
||||
}
|
||||
|
||||
void SetUp() {
|
||||
GoalTest::createDirIfAbsent(GoalTest::getTemplateDir(testCategory));
|
||||
GoalTest::createDirIfAbsent(GoalTest::getGeneratedDir(testCategory));
|
||||
}
|
||||
|
||||
void TearDown() {}
|
||||
|
||||
static std::thread runtime_thread;
|
||||
static Compiler compiler;
|
||||
static GoalTest::CompilerTestRunner runner;
|
||||
|
||||
std::string testCategory = "pointers";
|
||||
inja::Environment env{GoalTest::getTemplateDir(testCategory),
|
||||
GoalTest::getGeneratedDir(testCategory)};
|
||||
};
|
||||
|
||||
std::thread PointerTests::runtime_thread;
|
||||
Compiler PointerTests::compiler;
|
||||
GoalTest::CompilerTestRunner PointerTests::runner;
|
||||
|
||||
TEST_F(PointerTests, DeReference) {
|
||||
runner.run_static_test(env, testCategory, "deref-simple.static.gc", {"structure\n0\n"});
|
||||
}
|
||||
|
||||
TEST_F(PointerTests, Pointers) {
|
||||
runner.run_static_test(env, testCategory, "pointers.static.gc", {"13\n"});
|
||||
}
|
||||
Reference in New Issue
Block a user