forked from pikasTech/PikaPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (34 loc) · 970 Bytes
/
main.cpp
File metadata and controls
37 lines (34 loc) · 970 Bytes
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
#include "test_common.h"
extern "C" {
#include "dataMemory.h"
#include "pika_config_gtest.h"
}
extern "C" {
void test_purec(void);
}
int main(int argc, char** argv) {
int res = 0;
mkdir("./test/out/packout", 0777);
mkdir("./test/out/unpackout", 0777);
#if USE_GOOGLE_TEST
::testing::InitGoogleTest(&argc, argv);
res = RUN_ALL_TESTS();
#else
test_purec();
#endif
mem_pool_deinit();
#if PIKA_ARG_CACHE_ENABLE
extern PikaMemInfo g_PikaMemInfo;
#if PIKA_GC_MARK_SWEEP_ENABLE
extern PikaObjState g_PikaObjState;
printf("[ GC]: object num max: %d, last GC: %d\r\n",
g_PikaObjState.objCntMax, g_PikaObjState.objCntLastGC);
#endif
printf("[ Info]: alloc times: %d, cached times: %d (%0.2f%%)\r\n",
g_PikaMemInfo.alloc_times, g_PikaMemInfo.alloc_times_cache,
((float)g_PikaMemInfo.alloc_times_cache /
(float)g_PikaMemInfo.alloc_times) *
100.0);
#endif
return res;
}