diff options
author | sbc <sbc@chromium.org> | 2015-10-23 18:20:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-24 01:22:01 +0000 |
commit | 95ffabc8eb818b26009f0eff87db5be3ec1487a0 (patch) | |
tree | 2c5c7ff7def6ea9d3acf728d260364e8b5bc71cd /native_client_sdk/src/tests | |
parent | 939f64cf8b666cb2c1dbb777193b4ee4f1e52236 (diff) | |
download | chromium_src-95ffabc8eb818b26009f0eff87db5be3ec1487a0.zip chromium_src-95ffabc8eb818b26009f0eff87db5be3ec1487a0.tar.gz chromium_src-95ffabc8eb818b26009f0eff87db5be3ec1487a0.tar.bz2 |
[NaCl SDK] Allow ppapi_simple apps to use main entry point.
This change makes ppapi_simple into a linker script
since we need to force the __nacl_main symbol to be
included in the link line (its weak referenced by
_start as a replacement for main).
CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_nacl_sdk;tryserver.chromium.mac:mac_nacl_sdk;tryserver.chromium.win:win_nacl_sdk
BUG=246246
Review URL: https://codereview.chromium.org/18435011
Cr-Commit-Position: refs/heads/master@{#355947}
Diffstat (limited to 'native_client_sdk/src/tests')
6 files changed, 7 insertions, 24 deletions
diff --git a/native_client_sdk/src/tests/nacl_io_socket_test/example.dsc b/native_client_sdk/src/tests/nacl_io_socket_test/example.dsc index 7d9a593..ec4379b 100644 --- a/native_client_sdk/src/tests/nacl_io_socket_test/example.dsc +++ b/native_client_sdk/src/tests/nacl_io_socket_test/example.dsc @@ -10,9 +10,7 @@ 'echo_server.cc', 'echo_server.h', ], - 'DEPS': ['ppapi_simple', 'nacl_io'], - # Order matters here: gtest has a "main" function that will be used if - # referenced before ppapi. + 'DEPS': ['ppapi_simple_cpp', 'nacl_io'], 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'gmock', 'ppapi', 'gtest', 'nacl_io', 'pthread'], 'CXXFLAGS': ['-Wno-sign-compare'] } diff --git a/native_client_sdk/src/tests/nacl_io_socket_test/main.cc b/native_client_sdk/src/tests/nacl_io_socket_test/main.cc index 61066a2..e7ed5b8 100644 --- a/native_client_sdk/src/tests/nacl_io_socket_test/main.cc +++ b/native_client_sdk/src/tests/nacl_io_socket_test/main.cc @@ -5,6 +5,7 @@ #include <string> #include "gtest/gtest.h" + #include "ppapi/cpp/instance.h" #include "ppapi/cpp/var.h" #include "ppapi_simple/ps_main.h" @@ -42,7 +43,7 @@ class GTestEventListener : public ::testing::EmptyTestEventListener { } }; -int example_main(int argc, char* argv[]) { +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); if (PSGetInstanceId() != 0) { ::testing::UnitTest::GetInstance()->listeners() @@ -50,7 +51,3 @@ int example_main(int argc, char* argv[]) { } return RUN_ALL_TESTS(); } - -// Register the function to call once the Instance Object is initialized. -// see: pappi_simple/ps_main.h -PPAPI_SIMPLE_REGISTER_MAIN(example_main); diff --git a/native_client_sdk/src/tests/nacl_io_test/example.dsc b/native_client_sdk/src/tests/nacl_io_test/example.dsc index 43d588c..08899cd 100644 --- a/native_client_sdk/src/tests/nacl_io_test/example.dsc +++ b/native_client_sdk/src/tests/nacl_io_test/example.dsc @@ -61,9 +61,7 @@ 'socket_test.cc', 'tty_test.cc', ], - 'DEPS': ['ppapi_simple', 'nacl_io'], - # Order matters here: gtest has a "main" function that will be used if - # referenced before ppapi. + 'DEPS': ['ppapi_simple_cpp', 'nacl_io'], 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'gmock', 'nacl_io', 'ppapi', 'gtest', 'pthread'], 'INCLUDES': ["."], 'CXXFLAGS': ['-Wno-sign-compare'], diff --git a/native_client_sdk/src/tests/nacl_io_test/main.cc b/native_client_sdk/src/tests/nacl_io_test/main.cc index 31414e6..0db0151 100644 --- a/native_client_sdk/src/tests/nacl_io_test/main.cc +++ b/native_client_sdk/src/tests/nacl_io_test/main.cc @@ -42,7 +42,7 @@ class GTestEventListener : public ::testing::EmptyTestEventListener { } }; -int example_main(int argc, char* argv[]) { +int main(int argc, char* argv[]) { setenv("TERM", "xterm-256color", 0); ::testing::InitGoogleTest(&argc, argv); if (PSGetInstanceId() != 0) { @@ -51,7 +51,3 @@ int example_main(int argc, char* argv[]) { } return RUN_ALL_TESTS(); } - -// Register the function to call once the Instance Object is initialized. -// see: pappi_simple/ps_main.h -PPAPI_SIMPLE_REGISTER_MAIN(example_main); diff --git a/native_client_sdk/src/tests/sdk_util_test/example.dsc b/native_client_sdk/src/tests/sdk_util_test/example.dsc index 63b89ba..334d1da 100644 --- a/native_client_sdk/src/tests/sdk_util_test/example.dsc +++ b/native_client_sdk/src/tests/sdk_util_test/example.dsc @@ -10,9 +10,7 @@ 'main.cc', 'string_util_test.cc', ], - 'DEPS': ['ppapi_simple', 'sdk_util', 'nacl_io'], - # Order matters here: gtest has a "main" function that will be used if - # referenced before ppapi. + 'DEPS': ['ppapi_simple_cpp', 'sdk_util', 'nacl_io'], 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'gmock', 'nacl_io', 'ppapi', 'gtest', 'pthread'], 'CXXFLAGS': ['-Wno-sign-compare'] } diff --git a/native_client_sdk/src/tests/sdk_util_test/main.cc b/native_client_sdk/src/tests/sdk_util_test/main.cc index a715b1b..eb2a8ea 100644 --- a/native_client_sdk/src/tests/sdk_util_test/main.cc +++ b/native_client_sdk/src/tests/sdk_util_test/main.cc @@ -42,7 +42,7 @@ class GTestEventListener : public ::testing::EmptyTestEventListener { } }; -int example_main(int argc, char* argv[]) { +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); if (PSGetInstanceId() != 0) { ::testing::UnitTest::GetInstance()->listeners() @@ -50,7 +50,3 @@ int example_main(int argc, char* argv[]) { } return RUN_ALL_TESTS(); } - -// Register the function to call once the Instance Object is initialized. -// see: pappi_simple/ps_main.h -PPAPI_SIMPLE_REGISTER_MAIN(example_main); |