main.cpp 890 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "test_common.h"
  2. extern "C" {
  3. #include "dataMemory.h"
  4. #include "pika_config_gtest.h"
  5. }
  6. extern "C" {
  7. void test_purec(void);
  8. }
  9. int main(int argc, char** argv) {
  10. int res = 0;
  11. #if USE_GOOGLE_TEST
  12. ::testing::InitGoogleTest(&argc, argv);
  13. res = RUN_ALL_TESTS();
  14. #else
  15. test_purec();
  16. #endif
  17. mem_pool_deinit();
  18. #if PIKA_ARG_CACHE_ENABLE
  19. extern PikaMemInfo g_PikaMemInfo;
  20. #if PIKA_GC_MARK_SWEEP_ENABLE
  21. extern PikaObjState g_PikaObjState;
  22. printf("[ GC]: object num max: %d, last GC: %d\r\n",
  23. g_PikaObjState.objCntMax, g_PikaObjState.objCntLastGC);
  24. #endif
  25. printf("[ Info]: alloc times: %d, cached times: %d (%0.2f%%)\r\n",
  26. g_PikaMemInfo.alloc_times, g_PikaMemInfo.alloc_times_cache,
  27. ((float)g_PikaMemInfo.alloc_times_cache /
  28. (float)g_PikaMemInfo.alloc_times) *
  29. 100.0);
  30. #endif
  31. return res;
  32. }