summaryrefslogtreecommitdiff
path: root/deps/uv/test/runner-win.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-03-14 13:40:27 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-03-14 15:55:26 +0100
commite99dff461772ea16586448667860edd13b4190e4 (patch)
tree728e0b8b3aa7e44df46cce42c0f6310e7ea426d1 /deps/uv/test/runner-win.c
parent028c630ecd920d59fc0e8ad295e0fe0eac8e1ef1 (diff)
downloadandroid-node-v8-e99dff461772ea16586448667860edd13b4190e4.tar.gz
android-node-v8-e99dff461772ea16586448667860edd13b4190e4.tar.bz2
android-node-v8-e99dff461772ea16586448667860edd13b4190e4.zip
deps: upgrade libuv to 7b66ea1
Diffstat (limited to 'deps/uv/test/runner-win.c')
-rw-r--r--deps/uv/test/runner-win.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c
index 8f534bcdb7..3aae1c3e9c 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;