pikapython/test/main.cpp

36 lines
890 B
C
Raw Normal View History

#include "test_common.h"
2021-10-01 00:21:50 +08:00
2021-11-16 16:25:22 +08:00
extern "C" {
#include "dataMemory.h"
2022-05-02 19:49:47 +08:00
#include "pika_config_gtest.h"
2021-11-16 16:25:22 +08:00
}
2022-10-28 19:19:31 +08:00
extern "C" {
void test_purec(void);
2022-10-28 19:19:31 +08:00
}
2021-10-01 00:21:50 +08:00
int main(int argc, char** argv) {
int res = 0;
#if USE_GOOGLE_TEST
2021-11-16 16:25:22 +08:00
::testing::InitGoogleTest(&argc, argv);
res = RUN_ALL_TESTS();
2022-10-28 19:19:31 +08:00
#else
test_purec();
#endif
mem_pool_deinit();
2022-10-09 00:24:33 +08:00
#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
2022-10-09 00:24:33 +08:00
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) *
2022-10-09 00:24:33 +08:00
100.0);
#endif
return res;
2021-10-01 00:21:50 +08:00
}