EightBit/M6502/HarteTest_6502/processor_test_suite_t.cpp
Adrian Conlon 9e9c15e289 Use C++20 co-routines as generators for opcode suite and test generation.
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
2021-10-27 09:53:58 +01:00

14 lines
451 B
C++

#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) {
}
co_generator_t<opcode_test_suite_t> processor_test_suite_t::generator() {
std::filesystem::path directory = location();
for (const auto& entry : std::filesystem::directory_iterator{ directory })
co_yield opcode_test_suite_t(entry.path().string());
}