mirror of
https://github.com/reactos/CMake.git
synced 2025-02-26 06:55:34 +00:00

Since commit v3.11.0-rc1~117^2 (CTest: Re-implement test process handling using libuv, 2017-12-10) we do not give the child test processes any stdin. Prior to that change we let the child test processes inherit stdin from ctest itself. Tests that run serially might be able to use the real stdin meaningfully, so restore that behavior and add a test case. Fixes: #18591
19 lines
310 B
C
19 lines
310 B
C
#include <stdio.h>
|
|
|
|
int main()
|
|
{
|
|
char buf[1024];
|
|
size_t nIn = sizeof(buf);
|
|
while (nIn == sizeof(buf)) {
|
|
nIn = fread(buf, 1, sizeof(buf), stdin);
|
|
if (nIn > 0) {
|
|
size_t nOut;
|
|
nOut = fwrite(buf, 1, nIn, stdout);
|
|
if (nOut != nIn) {
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|