| OLD | NEW |
| 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 } |
| OLD | NEW |