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

Side by Side Diff: ports/devenv/tests/devenv_small_test.cc

Issue 1417223003: Switch from using 'nacl_main' to 'main' entry point (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 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 | « ports/devenv/jseval.c ('k') | ports/emacs-x/pkg_info » ('j') | 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) 2014 The Native Client Authors. All rights reserved. 1 // Copyright (c) 2014 The Native Client Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gtest/gtest.h" 5 #include "gtest/gtest.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <spawn.h> 9 #include <spawn.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 EXPECT_EQ(0, close(p[0])); 447 EXPECT_EQ(0, close(p[0]));
448 EXPECT_EQ(0, close(p[1])); 448 EXPECT_EQ(0, close(p[1]));
449 449
450 int status; 450 int status;
451 pid_t npid = waitpid(pid, &status, 0); 451 pid_t npid = waitpid(pid, &status, 0);
452 EXPECT_EQ(pid, npid); 452 EXPECT_EQ(pid, npid);
453 EXPECT_TRUE(WIFEXITED(status)); 453 EXPECT_TRUE(WIFEXITED(status));
454 EXPECT_EQ(42, WEXITSTATUS(status)); 454 EXPECT_EQ(42, WEXITSTATUS(status));
455 } 455 }
456 456
457 extern "C" int nacl_main(int argc, char **argv) { 457 int main(int argc, char **argv) {
458 if (argc == 4 && strcmp(argv[1], "return") == 0) { 458 if (argc == 4 && strcmp(argv[1], "return") == 0) {
459 return return_child(argc, argv); 459 return return_child(argc, argv);
460 } else if (argc == 4 && strcmp(argv[1], "_exit") == 0) { 460 } else if (argc == 4 && strcmp(argv[1], "_exit") == 0) {
461 return exit_child(argc, argv); 461 return exit_child(argc, argv);
462 } else if (argc == 2 && strcmp(argv[1], "pipes") == 0) { 462 } else if (argc == 2 && strcmp(argv[1], "pipes") == 0) {
463 return pipes_child(argc, argv); 463 return pipes_child(argc, argv);
464 } else if (argc == 4 && strcmp(argv[1], "cloexec_check") == 0) { 464 } else if (argc == 4 && strcmp(argv[1], "cloexec_check") == 0) {
465 return cloexec_check_child(argc, argv); 465 return cloexec_check_child(argc, argv);
466 } else if (argc == 2 && strcmp(argv[1], "echo") == 0) { 466 } else if (argc == 2 && strcmp(argv[1], "echo") == 0) {
467 char msg[] = "test"; 467 char msg[] = "test";
468 write(1, msg, sizeof(msg)); 468 write(1, msg, sizeof(msg));
469 return 0; 469 return 0;
470 } 470 }
471 // Preserve argv[0] for use in some tests. 471 // Preserve argv[0] for use in some tests.
472 argv0 = argv[0]; 472 argv0 = argv[0];
473 testing::InitGoogleTest(&argc, argv); 473 testing::InitGoogleTest(&argc, argv);
474 return RUN_ALL_TESTS(); 474 return RUN_ALL_TESTS();
475 } 475 }
OLDNEW
« no previous file with comments | « ports/devenv/jseval.c ('k') | ports/emacs-x/pkg_info » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698