xemu_perf_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
runtime_config.h
1#ifndef XEMU_PERF_TESTS_RUNTIME_CONFIG_H
2#define XEMU_PERF_TESTS_RUNTIME_CONFIG_H
3
4#include <memory>
5#include <vector>
6
7#include "configure.h"
8#include "tests/test_suite.h"
9
11 public:
12 enum class SkipConfiguration {
13 DEFAULT,
14 SKIPPED,
15 UNSKIPPED,
16 };
17
18 public:
19 RuntimeConfig() = default;
20 explicit RuntimeConfig(const RuntimeConfig&) = delete;
21
28 bool LoadConfig(const char* config_file_path, std::vector<std::string>& errors);
29
36 bool LoadConfigBuffer(const std::string& config_content, std::vector<std::string>& errors);
37
42 bool ApplyConfig(std::vector<std::shared_ptr<TestSuite>>& test_suites, std::vector<std::string>& errors);
43
44 [[nodiscard]] bool disable_autorun() const { return disable_autorun_; }
45 [[nodiscard]] bool enable_autorun_immediately() const { return enable_autorun_immediately_; }
46 [[nodiscard]] bool enable_shutdown_on_completion() const { return enable_shutdown_on_completion_; }
47 [[nodiscard]] bool skip_tests_by_default() const { return skip_tests_by_default_; }
48 [[nodiscard]] uint32_t reboot_or_shutdown_delay_ms() const { return reboot_or_shutdown_delay_ms_; }
49
50 [[nodiscard]] const std::string& output_directory_path() const { return output_directory_path_; }
51
52 static std::string SanitizePath(const std::string& path);
53
54 private:
55 bool disable_autorun_ = DEFAULT_DISABLE_AUTORUN;
56 bool enable_autorun_immediately_ = DEFAULT_AUTORUN_IMMEDIATELY;
57 bool enable_shutdown_on_completion_ = DEFAULT_ENABLE_SHUTDOWN;
58 bool skip_tests_by_default_ = DEFAULT_SKIP_TESTS_BY_DEFAULT;
59 uint32_t reboot_or_shutdown_delay_ms_ = 10000;
60
61 std::string output_directory_path_ = SanitizePath(DEFAULT_OUTPUT_DIRECTORY_PATH);
62
64 std::map<std::string, SkipConfiguration> configured_test_suites_;
66 std::map<std::string, std::map<std::string, SkipConfiguration>> configured_test_cases_;
67};
68
69#endif // XEMU_PERF_TESTS_RUNTIME_CONFIG_H
Definition runtime_config.h:10
bool LoadConfigBuffer(const std::string &config_content, std::vector< std::string > &errors)
Definition runtime_config.cpp:119
bool LoadConfig(const char *config_file_path, std::vector< std::string > &errors)
Definition runtime_config.cpp:42
bool ApplyConfig(std::vector< std::shared_ptr< TestSuite > > &test_suites, std::vector< std::string > &errors)
Definition runtime_config.cpp:281