From 005a8026bb424779a146e00cc48621ff1d72b807 Mon Sep 17 00:00:00 2001 From: CptAlanSmith <123112708+CptAlanSmith@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:25:15 +0100 Subject: Testing (#23) * Fixes for building scons * Initial proof of concept auto-testing Shows how we can pull loaded data and display it back * Re-did headless Because hubert insisted it be done like this ;) * Auto-Testing Framework Basics * Requirements Calculations * Fix for messy merge (teach me to use merge tools) * Fixing up misc merge issues to fully reconcile with master changes * Re-added missing getters * Move of testing files due to folder reorgs * Use new accessors + int reading fix --------- Co-authored-by: Hop311 --- src/openvic-simulation/testing/Testing.hpp | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/openvic-simulation/testing/Testing.hpp (limited to 'src/openvic-simulation/testing/Testing.hpp') diff --git a/src/openvic-simulation/testing/Testing.hpp b/src/openvic-simulation/testing/Testing.hpp new file mode 100644 index 0000000..35e8a96 --- /dev/null +++ b/src/openvic-simulation/testing/Testing.hpp @@ -0,0 +1,44 @@ +#pragma once +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace OpenVic { + + class Testing { + + public: + GameManager& game_manager; + Map& map; + BuildingManager& building_manager; + GoodManager& good_manager; + PopManager& pop_manager; + GameAdvancementHook& clock; + + std::vector test_scripts = std::vector(); + + //// Prototype test script + //const BuildingType* building_type = building_manager->get_building_type_by_identifier("building_fort"); + //std::cout << "building_fort" + // << " build time is " << building_type->get_build_time() << std::endl; + //std::cout << "building_fort" + // << " identifier is " << building_type->get_identifier() << std::endl; + //std::cout << "building_fort" + // << " max level is " << int(building_type->get_max_level()) << std::endl; + //for (const auto& good : good_manager->get_goods()) + // std::cout << good.get_identifier() << " price = " << good.get_base_price() << std::endl; + + Testing(GameManager& g_manager); + ~Testing(); + + void report_results(); + }; +} -- cgit v1.2.3-56-ga3b1