From 127ca294056817bc5814ef5516b29a67ff3fa3bb Mon Sep 17 00:00:00 2001 From: CptAlanSmith <123112708+CptAlanSmith@users.noreply.github.com> Date: Mon, 25 Sep 2023 20:51:49 +0100 Subject: Testing (#28) * Dataloader stubs + default compat path + bits+bobs * Followup big dataloader commit * Fixes for building scons * Initial proof of concept auto-testing Shows how we can pull loaded data and display it back * data-loader include * 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 * Update of file tests * Test scripting updates - elimnination of issues with data variables hanging over from big merges Routed gamemanager down to scripts on execute * Update StringUtils.hpp * Initial pipeline building * Pipe fabrication * Continued work on goods testing, removal of pragma once lines * Finish of economy tests, initial results outputting * Output of results * Removal of direct.h for cross compatibility --------- Co-authored-by: Hop311 --- src/openvic-simulation/testing/TestScript.hpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/openvic-simulation/testing/TestScript.hpp') diff --git a/src/openvic-simulation/testing/TestScript.hpp b/src/openvic-simulation/testing/TestScript.hpp index c41767b..874e083 100644 --- a/src/openvic-simulation/testing/TestScript.hpp +++ b/src/openvic-simulation/testing/TestScript.hpp @@ -1,12 +1,15 @@ #pragma once #include #include +#include namespace OpenVic { class TestScript { - std::vector requirements = std::vector(); + std::vector requirements = std::vector(); + GameManager* game_manager; + std::string script_name; public: @@ -17,14 +20,19 @@ namespace OpenVic { virtual void execute_script() = 0; // Getters - std::vector get_requirements(); - Requirement get_requirement_at_index(int index); - Requirement get_requirement_by_id(std::string id); - std::vector get_passed_requirements(); - std::vector get_failed_requirements(); + std::vector get_requirements(); + Requirement* get_requirement_at_index(int index); + Requirement* get_requirement_by_id(std::string id); + std::vector get_passed_requirements(); + std::vector get_failed_requirements(); + std::vector get_untested_requirements(); + GameManager* get_game_manager(); + std::string get_script_name(); // Setters - void set_requirements(std::vector in_requirements); - void add_requirement(Requirement req); + void set_requirements(std::vector in_requirements); + void add_requirement(Requirement* req); + void set_game_manager(GameManager* in_game_manager); + void set_script_name(std::string in_script_name); }; } -- cgit v1.2.3-56-ga3b1