protot/3rdparty/bx/tests/main_test.cpp

44 lines
955 B
C++
Raw Permalink Normal View History

2016-11-10 21:53:08 +01:00
/*
2017-04-11 08:16:10 +02:00
* Copyright 2010-2017 Branimir Karadzic. All rights reserved.
2016-11-10 21:53:08 +01:00
* License: https://github.com/bkaradzic/bx#license-bsd-2-clause
*/
#include "test.h"
static const char* s_argv[] = { "bx.test" };
2017-04-11 08:16:10 +02:00
int runAllTests(int _argc, const char* _argv[]);
2016-11-10 21:53:08 +01:00
#if BX_PLATFORM_ANDROID
# include <android/native_activity.h>
void ANativeActivity_onCreate(ANativeActivity*, void*, size_t)
{
exit(runAllTests(BX_COUNTOF(s_argv), s_argv) );
}
#elif BX_PLATFORM_NACL
# include <ppapi/c/pp_errors.h>
# include <ppapi/c/ppp.h>
PP_EXPORT const void* PPP_GetInterface(const char* /*_name*/)
{
return NULL;
}
PP_EXPORT int32_t PPP_InitializeModule(PP_Module /*_module*/, PPB_GetInterface /*_interface*/)
{
DBG("PPAPI version: %d", PPAPI_RELEASE);
runAllTests(BX_COUNTOF(s_argv), s_argv);
return PP_ERROR_NOINTERFACE;
}
PP_EXPORT void PPP_ShutdownModule()
{
}
#else
int main(int _argc, const char* _argv[])
{
return runAllTests(_argc, _argv);
}
#endif // BX_PLATFORM