diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-03-14 13:40:27 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-03-14 15:55:26 +0100 |
commit | e99dff461772ea16586448667860edd13b4190e4 (patch) | |
tree | 728e0b8b3aa7e44df46cce42c0f6310e7ea426d1 /deps/uv/test | |
parent | 028c630ecd920d59fc0e8ad295e0fe0eac8e1ef1 (diff) | |
download | node-e99dff461772ea16586448667860edd13b4190e4.tar.gz |
deps: upgrade libuv to 7b66ea1
Diffstat (limited to 'deps/uv/test')
-rw-r--r-- | deps/uv/test/runner-win.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c index 8f534bcdb..3aae1c3e9 100644 --- a/deps/uv/test/runner-win.c +++ b/deps/uv/test/runner-win.c @@ -44,6 +44,11 @@ /* Do platform-specific initialization. */ void platform_init(int argc, char **argv) { + const char* tap; + + tap = getenv("UV_TAP_OUTPUT"); + tap_output = (tap != NULL && atoi(tap) > 0); + /* Disable the "application crashed" popup. */ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); @@ -207,13 +212,34 @@ long int process_output_size(process_info_t *p) { int process_copy_output(process_info_t *p, int fd) { DWORD read; char buf[1024]; + char *line, *start; if (SetFilePointer(p->stdio_out, 0, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER) return -1; + if (tap_output) + write(fd, "#", 1); + while (ReadFile(p->stdio_out, (void*)&buf, sizeof(buf), &read, NULL) && - read > 0) - write(fd, buf, read); + read > 0) { + if (tap_output) { + start = buf; + + while ((line = strchr(start, '\n')) != NULL) { + write(fd, start, line - start + 1); + write(fd, "#", 1); + start = line + 1; + } + + if (start < buf + read) + write(fd, start, buf + read - start); + } else { + write(fd, buf, read); + } + } + + if (tap_output) + write(fd, "\n", 1); if (GetLastError() != ERROR_HANDLE_EOF) return -1; |