| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <fcntl.h> | 5 #include <fcntl.h> |
| 6 #include <launchpad/launchpad.h> | 6 #include <launchpad/launchpad.h> |
| 7 #include <launchpad/vmo.h> | 7 #include <launchpad/vmo.h> |
| 8 #include <magenta/status.h> | 8 #include <magenta/status.h> |
| 9 #include <magenta/syscalls.h> | 9 #include <magenta/syscalls.h> |
| 10 #include <magenta/syscalls/object.h> | 10 #include <magenta/syscalls/object.h> |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 char** test_stderr) { | 245 char** test_stderr) { |
| 246 int stdout_pipe = -1; | 246 int stdout_pipe = -1; |
| 247 int stderr_pipe = -1; | 247 int stderr_pipe = -1; |
| 248 mx_handle_t p = start_test(binary_vmo, test_name, &stdout_pipe, &stderr_pipe); | 248 mx_handle_t p = start_test(binary_vmo, test_name, &stdout_pipe, &stderr_pipe); |
| 249 RETURN_IF_ERROR(p); | 249 RETURN_IF_ERROR(p); |
| 250 | 250 |
| 251 drain_fd(stdout_pipe, test_stdout); | 251 drain_fd(stdout_pipe, test_stdout); |
| 252 drain_fd(stderr_pipe, test_stderr); | 252 drain_fd(stderr_pipe, test_stderr); |
| 253 | 253 |
| 254 mx_status_t r = | 254 mx_status_t r = |
| 255 mx_handle_wait_one(p, MX_PROCESS_SIGNALED, MX_TIME_INFINITE, NULL); | 255 mx_object_wait_one(p, MX_PROCESS_SIGNALED, MX_TIME_INFINITE, NULL); |
| 256 RETURN_IF_ERROR(r); | 256 RETURN_IF_ERROR(r); |
| 257 | 257 |
| 258 mx_info_process_t proc_info; | 258 mx_info_process_t proc_info; |
| 259 mx_status_t status = mx_object_get_info(p, MX_INFO_PROCESS, &proc_info, | 259 mx_status_t status = mx_object_get_info(p, MX_INFO_PROCESS, &proc_info, |
| 260 sizeof(proc_info), nullptr, nullptr); | 260 sizeof(proc_info), nullptr, nullptr); |
| 261 RETURN_IF_ERROR(status); | 261 RETURN_IF_ERROR(status); |
| 262 | 262 |
| 263 r = mx_handle_close(p); | 263 r = mx_handle_close(p); |
| 264 RETURN_IF_ERROR(r); | 264 RETURN_IF_ERROR(r); |
| 265 return proc_info.return_code; | 265 return proc_info.return_code; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 RETURN_IF_ERROR(status); | 427 RETURN_IF_ERROR(status); |
| 428 | 428 |
| 429 // Complain if we didn't try to run all of the tests. | 429 // Complain if we didn't try to run all of the tests. |
| 430 if (test_list_index != lines_count) { | 430 if (test_list_index != lines_count) { |
| 431 fprintf(stderr, "Failed to attempt all the tests!\n"); | 431 fprintf(stderr, "Failed to attempt all the tests!\n"); |
| 432 fflush(0); | 432 fflush(0); |
| 433 return -1; | 433 return -1; |
| 434 } | 434 } |
| 435 return 0; | 435 return 0; |
| 436 } | 436 } |
| OLD | NEW |