main_test.cpp 955 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright 2010-2017 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
  4. */
  5. #include "test.h"
  6. static const char* s_argv[] = { "bx.test" };
  7. int runAllTests(int _argc, const char* _argv[]);
  8. #if BX_PLATFORM_ANDROID
  9. # include <android/native_activity.h>
  10. void ANativeActivity_onCreate(ANativeActivity*, void*, size_t)
  11. {
  12. exit(runAllTests(BX_COUNTOF(s_argv), s_argv) );
  13. }
  14. #elif BX_PLATFORM_NACL
  15. # include <ppapi/c/pp_errors.h>
  16. # include <ppapi/c/ppp.h>
  17. PP_EXPORT const void* PPP_GetInterface(const char* /*_name*/)
  18. {
  19. return NULL;
  20. }
  21. PP_EXPORT int32_t PPP_InitializeModule(PP_Module /*_module*/, PPB_GetInterface /*_interface*/)
  22. {
  23. DBG("PPAPI version: %d", PPAPI_RELEASE);
  24. runAllTests(BX_COUNTOF(s_argv), s_argv);
  25. return PP_ERROR_NOINTERFACE;
  26. }
  27. PP_EXPORT void PPP_ShutdownModule()
  28. {
  29. }
  30. #else
  31. int main(int _argc, const char* _argv[])
  32. {
  33. return runAllTests(_argc, _argv);
  34. }
  35. #endif // BX_PLATFORM