diff --git a/tests/fastweb.cpp b/tests/fastweb.cpp index e67d728..7969fac 100644 --- a/tests/fastweb.cpp +++ b/tests/fastweb.cpp @@ -43,9 +43,10 @@ std::pair execute_command(const std::string& command){ throw std::runtime_error("popen() failed!"); } - // Read the output a line at a time - output it. + // Read and tee to stdout so logs appear as the subprocess writes (not only after exit). while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) { result += buffer.data(); + std::cout << buffer.data() << std::flush; } // Get the return code @@ -264,7 +265,7 @@ void fastweb::uninstall_module(std::string ini_filepath, std::string name) else { std::cout<<"卸载失败:"<