stuff-from-scratch/test/compiler/TestTemplatingEngine.cpp

20 lines
426 B
C++
Raw Normal View History

2022-10-12 08:01:19 +00:00
#include "TemplatingEngine.h"
2022-10-20 08:00:39 +00:00
#include <File.h>
2022-11-29 18:00:19 +00:00
#include "TestFramework.h"
2022-10-20 08:00:39 +00:00
2022-10-12 08:01:19 +00:00
#include <filesystem>
#include <iostream>
2022-11-29 18:00:19 +00:00
TEST_CASE(TestTemplatingEngine, "compiler")
2022-10-12 08:01:19 +00:00
{
const auto data_loc = std::filesystem::path(__FILE__) / "../../data";
auto engine = TemplatingEngine(data_loc);
engine.loadTemplateFiles();
2022-10-20 08:00:39 +00:00
const auto content = engine.processTemplate("index");
2022-10-12 08:01:19 +00:00
2022-10-20 08:00:39 +00:00
File outfile("index.html");
outfile.WriteText(content);
2022-11-29 18:00:19 +00:00
}