2021-10-10 20:26:30 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <filesystem>
|
|
|
|
|
|
|
|
#include "TestRunner.h"
|
|
|
|
#include "test_t.h"
|
|
|
|
#include "opcode_test_suite_t.h"
|
|
|
|
|
|
|
|
int main() {
|
2021-10-11 09:20:18 +00:00
|
|
|
|
2021-10-10 20:26:30 +00:00
|
|
|
std::filesystem::path location = "C:\\github\\spectrum\\libraries\\EightBit\\modules\\ProcessorTests\\6502\\v1";
|
|
|
|
|
|
|
|
for (const auto& entry : std::filesystem::directory_iterator{ location }) {
|
|
|
|
|
|
|
|
const auto path = entry.path();
|
2021-10-11 09:20:18 +00:00
|
|
|
|
|
|
|
const auto filename = path.filename();
|
|
|
|
std::cout << "Processing: " << filename << "\n";
|
2021-10-10 20:26:30 +00:00
|
|
|
|
|
|
|
opcode_test_suite_t opcode(path.string());
|
|
|
|
opcode.load();
|
|
|
|
const auto& opcode_test_array = opcode.get_array();
|
2021-10-11 09:20:18 +00:00
|
|
|
|
|
|
|
bool opcode_bad = false;
|
2021-10-10 20:26:30 +00:00
|
|
|
for (const auto& opcode_test_element : opcode_test_array) {
|
|
|
|
|
|
|
|
const auto opcode_test = test_t(opcode_test_element);
|
|
|
|
|
|
|
|
TestRunner runner(opcode_test);
|
2021-10-11 09:20:18 +00:00
|
|
|
const auto good = runner.check();
|
|
|
|
if (!good) {
|
|
|
|
if (!opcode_bad) {
|
|
|
|
std::cout << "** Failed: " << opcode_test.name() << "\n";
|
|
|
|
for (const auto& message : runner.messages())
|
|
|
|
std::cout << "**** " << message << "\n";
|
|
|
|
opcode_bad = true;
|
|
|
|
}
|
|
|
|
}
|
2021-10-10 20:26:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|