// Step 1945: PipelineExecutionPlan // // t1: addStage and addEdge; isValid // t2: executionOrder respects topological order // t3: languageSequence returns language per stage in order // t4: boundaryPairs detects language transitions // t5: isValid false on cycle; empty plan invalid #include "PipelineExecutionPlan.h" #include #include namespace ws = whetstone; static int p=0,f=0; #define T(n) { std::cout<<" "<<#n<<"... "; } #define P() { std::cout<<"PASS\n"; ++p; } #define F(m) { std::cout<<"FAIL: "<Rust") hasPyRs = true; C(hasPyRs, "Python->Rust boundary"); // Same-language stages produce no boundary ws::PipelineExecutionPlan p2; p2.addStage({"a","Go","","",""}); p2.addStage({"b","Go","","",""}); p2.addEdge("a","b"); C(p2.boundaryPairs().empty(), "no boundary for same language"); P(); } void t5(){ T(isValid_cycle_and_empty); ws::PipelineExecutionPlan empty; C(!empty.isValid(), "empty plan invalid"); ws::PipelineExecutionPlan cyclic; cyclic.addStage({"a","Python","","",""}); cyclic.addStage({"b","Rust","","",""}); cyclic.addEdge("a","b"); cyclic.addEdge("b","a"); C(!cyclic.isValid(), "cyclic plan invalid"); P(); } int main(){ std::cout << "Step 1945: PipelineExecutionPlan\n"; t1(); t2(); t3(); t4(); t5(); std::cout << "\n" << p << "/" << (p+f) << " passed\n"; return f > 0 ? 1 : 0; }