Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(899)

Side by Side Diff: runtime/bin/run_vm_tests_fuchsia.cc

Issue 2511983002: Move fuchsia tests to new mx_object_get_info style (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698