diff options
author | CptAlanSmith <123112708+CptAlanSmith@users.noreply.github.com> | 2023-09-23 20:25:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 20:25:15 +0200 |
commit | 005a8026bb424779a146e00cc48621ff1d72b807 (patch) | |
tree | dde15211e31d861b61711bf6aebdeb8713393d53 /src/openvic-simulation/testing/TestScript.hpp | |
parent | ebea2e473eefa3945508b0bf622a472b62d70d3b (diff) |
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 <hop3114@gmail.com>
Diffstat (limited to 'src/openvic-simulation/testing/TestScript.hpp')
-rw-r--r-- | src/openvic-simulation/testing/TestScript.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/openvic-simulation/testing/TestScript.hpp b/src/openvic-simulation/testing/TestScript.hpp new file mode 100644 index 0000000..c41767b --- /dev/null +++ b/src/openvic-simulation/testing/TestScript.hpp @@ -0,0 +1,30 @@ +#pragma once +#include <testing/Requirement.hpp> +#include <vector> + +namespace OpenVic { + + class TestScript { + + std::vector<Requirement> requirements = std::vector<Requirement>(); + + public: + + // expects an overriden method that performs arbitrary code execution + // so that each script uniquely performs tests + // for both requirement adding to script and to execute code + virtual void add_requirements() = 0; + virtual void execute_script() = 0; + + // Getters + std::vector<Requirement> get_requirements(); + Requirement get_requirement_at_index(int index); + Requirement get_requirement_by_id(std::string id); + std::vector<Requirement> get_passed_requirements(); + std::vector<Requirement> get_failed_requirements(); + + // Setters + void set_requirements(std::vector<Requirement> in_requirements); + void add_requirement(Requirement req); + }; +} |