Quick commit of a broken setup that doesn't work.

This commit is contained in:
Zed A. Shaw 2026-09-09 12:19:09 -04:00
parent 22c2b78fca
commit 753df69b4c
129 changed files with 16095 additions and 0 deletions

View file

@ -0,0 +1,46 @@
#include <fuc2/testing.hpp>
#include "components.hpp"
#include <fstream>
#include "json.hpp"
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using namespace fuc2;
/*
* This also tests Mesh by using Model to load them.
*/
namespace config_tests {
void test_json_components() {
std::ifstream f{"tests/config.json"};
auto j = json::parse(f);
auto mat = j["material_test"].get<components::Material>();
CHECK(mat.ambient.x == 0.1f, "wrong value");
auto light = j["lighting_test"].get<components::Lighting>();
auto camera = j["camera_test"].get<components::Camera>();
auto model = j["model_test"].get<components::Model>();
auto thing = j["thing_test"].get<components::Thing>();
}
void test_load_json_config() {
std::ifstream f{"config.json"};
auto j = json::parse(f);
auto scene = j["scene"].get<components::Scene>();
}
fuc2::Set TESTS{
.name="config",
.options={ .fail_fast=false },
.tests={
TEST(test_json_components),
TEST(test_load_json_config),
}
};
}