2021-10-27 08:53:58 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "processor_test_suite_t.h"
|
|
|
|
|
|
|
|
#include <filesystem>
|
|
|
|
|
|
|
|
processor_test_suite_t::processor_test_suite_t(std::string location) noexcept
|
|
|
|
: m_location(location) {
|
|
|
|
}
|
2021-12-08 19:54:53 +00:00
|
|
|
|
2022-01-03 00:50:41 +00:00
|
|
|
#ifdef USE_COROUTINES
|
2022-01-01 13:20:34 +00:00
|
|
|
#if __cplusplus >= 202002L
|
2021-12-17 09:19:16 +00:00
|
|
|
EightBit::co_generator_t<opcode_test_suite_t> processor_test_suite_t::generator() {
|
2021-10-27 08:53:58 +00:00
|
|
|
std::filesystem::path directory = location();
|
|
|
|
for (const auto& entry : std::filesystem::directory_iterator{ directory })
|
|
|
|
co_yield opcode_test_suite_t(entry.path().string());
|
|
|
|
}
|
2022-01-01 13:20:34 +00:00
|
|
|
#else
|
|
|
|
void processor_test_suite_t::generator(boost::coroutines2::coroutine<opcode_test_suite_t>::push_type& sink) {
|
|
|
|
std::filesystem::path directory = location();
|
|
|
|
for (const auto& entry : std::filesystem::directory_iterator{ directory })
|
|
|
|
sink(opcode_test_suite_t(entry.path().string()));
|
|
|
|
}
|
|
|
|
#endif
|
2022-01-03 00:50:41 +00:00
|
|
|
#else
|
|
|
|
std::vector<opcode_test_suite_t> processor_test_suite_t::generate() {
|
|
|
|
std::vector<opcode_test_suite_t> returned;
|
|
|
|
std::filesystem::path directory = location();
|
|
|
|
for (const auto& entry : std::filesystem::directory_iterator{ directory })
|
|
|
|
returned.push_back(opcode_test_suite_t(entry.path().string()));
|
|
|
|
return returned;
|
|
|
|
}
|
|
|
|
#endif
|