MCPcopy Create free account
hub / github.com/Kitware/CMake / testUVProcessChainExternalLoop

Function testUVProcessChainExternalLoop

Tests/CMakeLib/testUVProcessChain.cxx:672–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672bool testUVProcessChainExternalLoop(char const* helperCommand)
673{
674 cm::uv_loop_ptr loop;
675 loop.init();
676
677 cmUVProcessChainBuilder builder;
678 builder.AddCommand({ helperCommand, "echo" })
679 .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
680 .SetExternalLoop(*loop);
681 if (builder.GetLoop() != loop) {
682 std::cout << "GetLoop() should return external loop" << std::endl;
683 return false;
684 }
685
686 auto chain = builder.Start();
687
688 if (&chain.GetLoop() != loop) {
689 std::cout << "GetLoop() should return external loop" << std::endl;
690 return false;
691 }
692
693 if (!chain.Wait()) {
694 std::cout << "Wait() timed out" << std::endl;
695 return false;
696 }
697
698 cmUVIStream stream(chain.OutputStream());
699 std::string output = getInput(stream);
700 if (output != "HELLO world!") {
701 std::cout << "Output was \"" << output << "\", expected \"HELLO world!\""
702 << std::endl;
703 return false;
704 }
705
706 return true;
707}
708
709int testUVProcessChain(int argc, char** const argv)
710{

Callers 1

testUVProcessChainFunction · 0.85

Calls 7

getInputFunction · 0.85
GetLoopMethod · 0.80
OutputStreamMethod · 0.80
initMethod · 0.45
AddCommandMethod · 0.45
StartMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…