blob: f6aaa90d538c55a7bb2c40238d55ec5cfe13b9a2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/*
* Copyright 2010-2016 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bx#license-bsd-2-clause
*/
#define CATCH_CONFIG_RUNNER
#include "test.h"
static const char* s_argv[] = { "bx.test" };
int runAllTests(int _argc, const char* _argv[])
{
DBG(BX_COMPILER_NAME " / " BX_CPU_NAME " / " BX_ARCH_NAME " / " BX_PLATFORM_NAME);
return Catch::Session().run(_argc, _argv);
}
#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
|