| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 RETURN_IF_ERROR(p); | 269 RETURN_IF_ERROR(p); |
| 270 | 270 |
| 271 drain_fd(stdout_pipe, test_stdout); | 271 drain_fd(stdout_pipe, test_stdout); |
| 272 drain_fd(stderr_pipe, test_stderr); | 272 drain_fd(stderr_pipe, test_stderr); |
| 273 | 273 |
| 274 mx_status_t r = | 274 mx_status_t r = |
| 275 mx_handle_wait_one(p, MX_SIGNAL_SIGNALED, MX_TIME_INFINITE, NULL); | 275 mx_handle_wait_one(p, MX_SIGNAL_SIGNALED, MX_TIME_INFINITE, NULL); |
| 276 RETURN_IF_ERROR(r); | 276 RETURN_IF_ERROR(r); |
| 277 | 277 |
| 278 mx_info_process_t proc_info; | 278 mx_info_process_t proc_info; |
| 279 mx_size_t info_size; | 279 mx_status_t status = mx_object_get_info(p, MX_INFO_PROCESS, &proc_info, |
| 280 mx_status_t status = | 280 sizeof(proc_info), nullptr, nullptr); |
| 281 mx_object_get_info(p, MX_INFO_PROCESS, sizeof(proc_info.rec), &proc_info, | |
| 282 sizeof(proc_info), &info_size); | |
| 283 RETURN_IF_ERROR(status); | 281 RETURN_IF_ERROR(status); |
| 284 | 282 |
| 285 r = mx_handle_close(p); | 283 r = mx_handle_close(p); |
| 286 RETURN_IF_ERROR(r); | 284 RETURN_IF_ERROR(r); |
| 287 return proc_info.rec.return_code; | 285 return proc_info.return_code; |
| 288 } | 286 } |
| 289 | 287 |
| 290 | 288 |
| 291 static void handle_result(intptr_t result, | 289 static void handle_result(intptr_t result, |
| 292 char* test_stdout, | 290 char* test_stdout, |
| 293 char* test_stderr, | 291 char* test_stderr, |
| 294 const char* test) { | 292 const char* test) { |
| 295 if (result != 0) { | 293 if (result != 0) { |
| 296 if (!isExpectFail(test) && !isBug(test)) { | 294 if (!isExpectFail(test) && !isBug(test)) { |
| 297 printf("**** Test %s FAILED\n\nstdout:\n%s\nstderr:\n%s\n", test, | 295 printf("**** Test %s FAILED\n\nstdout:\n%s\nstderr:\n%s\n", test, |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 RETURN_IF_ERROR(status); | 447 RETURN_IF_ERROR(status); |
| 450 | 448 |
| 451 // Complain if we didn't try to run all of the tests. | 449 // Complain if we didn't try to run all of the tests. |
| 452 if (test_list_index != lines_count) { | 450 if (test_list_index != lines_count) { |
| 453 fprintf(stderr, "Failed to attempt all the tests!\n"); | 451 fprintf(stderr, "Failed to attempt all the tests!\n"); |
| 454 fflush(0); | 452 fflush(0); |
| 455 return -1; | 453 return -1; |
| 456 } | 454 } |
| 457 return 0; | 455 return 0; |
| 458 } | 456 } |
| OLD | NEW |