2021-10-10 20:26:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2021-10-11 13:59:23 +00:00
|
|
|
|
2022-01-03 00:50:41 +00:00
|
|
|
#ifdef USE_COROUTINES
|
2022-01-01 13:20:34 +00:00
|
|
|
#if __cplusplus >= 202002L
|
|
|
|
# include <co_generator_t.h>
|
|
|
|
#else
|
|
|
|
# include <boost/coroutine2/all.hpp>
|
|
|
|
#endif
|
2022-01-03 00:50:41 +00:00
|
|
|
# include <vector>
|
|
|
|
#endif
|
2021-12-17 09:19:16 +00:00
|
|
|
|
2021-10-24 12:39:08 +00:00
|
|
|
#include "parser_t.h"
|
2021-10-27 08:53:58 +00:00
|
|
|
#include "test_t.h"
|
2021-10-11 21:09:03 +00:00
|
|
|
|
2021-10-24 12:39:08 +00:00
|
|
|
class opcode_test_suite_t final : public parser_t {
|
2021-10-10 20:26:30 +00:00
|
|
|
private:
|
2021-10-24 12:39:08 +00:00
|
|
|
[[nodiscard]] auto array() const noexcept { return raw().get_array(); }
|
2021-10-10 20:26:30 +00:00
|
|
|
|
|
|
|
public:
|
2021-10-27 08:53:58 +00:00
|
|
|
opcode_test_suite_t() noexcept {}
|
2021-10-24 12:39:08 +00:00
|
|
|
opcode_test_suite_t(std::string path) noexcept;
|
2021-10-22 09:51:36 +00:00
|
|
|
|
2021-10-24 12:39:08 +00:00
|
|
|
[[nodiscard]] auto begin() const noexcept { return array().begin(); }
|
|
|
|
[[nodiscard]] auto end() const noexcept { return array().end(); }
|
2022-01-06 09:50:58 +00:00
|
|
|
[[nodiscard]] auto size() const noexcept { return array().size(); }
|
2021-10-27 08:53:58 +00:00
|
|
|
|
2022-01-03 00:50:41 +00:00
|
|
|
#ifdef USE_COROUTINES
|
2022-01-01 13:20:34 +00:00
|
|
|
#if __cplusplus >= 202002L
|
2022-01-06 09:50:58 +00:00
|
|
|
[[nodiscard]] EightBit::co_generator_t<test_t> generator() const;
|
2022-01-01 13:20:34 +00:00
|
|
|
#else
|
2022-01-06 09:50:58 +00:00
|
|
|
void generator(boost::coroutines2::coroutine<test_t>::push_type& sink) const;
|
2022-01-01 13:20:34 +00:00
|
|
|
#endif
|
2022-01-03 00:50:41 +00:00
|
|
|
#else
|
2022-01-06 09:50:58 +00:00
|
|
|
std::vector<test_t> generate() const;
|
2022-01-03 00:50:41 +00:00
|
|
|
#endif
|
2021-10-10 20:26:30 +00:00
|
|
|
};
|