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

Side by Side Diff: ports/nacl-spawn/nacl_spawn_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/nacl-spawn/cli_main.c ('k') | ports/nano/build.sh » ('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 2015 The Native Client Authors. All rights reserved. 1 // Copyright 2015 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 "nacl_main.h"
8
9 // These unittests should be run in the sel_ldr. In this mode 7 // These unittests should be run in the sel_ldr. In this mode
10 // nacl_io should not be initialized since we want direct access 8 // nacl_io should not be initialized since we want direct access
11 // to the real filesystem. Verify this by checking the value 9 // to the real filesystem. Verify this by checking the value
12 // or getcwd() 10 // or getcwd()
13 TEST(NaClSpawn, test_nacl_io_not_initialized) { 11 TEST(NaClSpawn, test_nacl_io_not_initialized) {
14 const char* cwd = getcwd(NULL, 0); 12 const char* cwd = getcwd(NULL, 0);
15 printf("cwd: %s\n", cwd); 13 printf("cwd: %s\n", cwd);
16 ASSERT_NE((char*)NULL, strstr(cwd, "out/build/nacl-spawn")); 14 ASSERT_NE((char*)NULL, strstr(cwd, "out/build/nacl-spawn"));
17 } 15 }
18 16
19 int nacl_main(int argc, char** argv) { 17 extern bool _cli_main_init;
18
19 TEST(NaClSpawn, test_cli_main_called) {
20 ASSERT_EQ(true, _cli_main_init);
21 }
22
23 int main(int argc, char** argv) {
20 setenv("TERM", "xterm-256color", 0); 24 setenv("TERM", "xterm-256color", 0);
21 ::testing::InitGoogleTest(&argc, argv); 25 ::testing::InitGoogleTest(&argc, argv);
22 return RUN_ALL_TESTS(); 26 return RUN_ALL_TESTS();
23 } 27 }
OLDNEW
« no previous file with comments | « ports/nacl-spawn/cli_main.c ('k') | ports/nano/build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698