| 670 | } |
| 671 | |
| 672 | bool 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 | |
| 709 | int testUVProcessChain(int argc, char** const argv) |
| 710 | { |
no test coverage detected
searching dependent graphs…