Files
whetstone_DSL/editor/tests/step683_test.cpp

85 lines
2.1 KiB
C++
Raw Normal View History

// Step 683: Sprint 44 integration summary (8 tests)
#include "Sprint44IntegrationSummary.h"
#include <iostream>
#include <string>
static int passed = 0, failed = 0;
#define TEST(name) { std::cout << " " << #name << "... "; }
#define PASS() { std::cout << "PASS\n"; ++passed; }
#define FAIL(msg) { std::cout << "FAIL: " << msg << "\n"; ++failed; }
#define CHECK(cond, msg) if (!(cond)) { FAIL(msg); return; }
void t1() {
TEST(struct_constructable);
auto r = Sprint44IntegrationSummary::run();
CHECK(r.stepsCompleted >= 0, "not constructable");
PASS();
}
void t2() {
TEST(resolver_works);
auto r = Sprint44IntegrationSummary::run();
CHECK(r.resolverWorks, "resolver false");
PASS();
}
void t3() {
TEST(scorer_works);
auto r = Sprint44IntegrationSummary::run();
CHECK(r.scorerWorks, "scorer false");
PASS();
}
void t4() {
TEST(auditor_works);
auto r = Sprint44IntegrationSummary::run();
CHECK(r.auditorWorks, "auditor false");
PASS();
}
void t5() {
TEST(steps_completed_is_5);
auto r = Sprint44IntegrationSummary::run();
CHECK(r.stepsCompleted == 5, "expected 5");
PASS();
}
void t6() {
TEST(files_added_contains_resolver);
auto r = Sprint44IntegrationSummary::run();
bool found = false;
for (const auto& f : r.filesAdded) {
if (f.find("PrerequisiteOpResolver.h") != std::string::npos) { found = true; break; }
}
CHECK(found, "resolver file missing");
PASS();
}
void t7() {
TEST(files_added_contains_scorer);
auto r = Sprint44IntegrationSummary::run();
bool found = false;
for (const auto& f : r.filesAdded) {
if (f.find("SelfContainmentScorer.h") != std::string::npos) { found = true; break; }
}
CHECK(found, "scorer file missing");
PASS();
}
void t8() {
TEST(success_true);
auto r = Sprint44IntegrationSummary::run();
CHECK(r.success, "success false");
PASS();
}
int main() {
std::cout << "Step 683: Sprint 44 integration summary\n";
t1(); t2(); t3(); t4(); t5(); t6(); t7(); t8();
std::cout << "\nResults: " << passed << "/" << (passed + failed) << " passed\n";
return failed == 0 ? 0 : 1;
}