main.cpp 970 B

12345678910111213141516171819202122232425262728293031323334353637
  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. mkdir("./test/out/packout", 0777);
  12. mkdir("./test/out/unpackout", 0777);
  13. #if USE_GOOGLE_TEST
  14. ::testing::InitGoogleTest(&argc, argv);
  15. res = RUN_ALL_TESTS();
  16. #else
  17. test_purec();
  18. #endif
  19. mem_pool_deinit();
  20. #if PIKA_ARG_CACHE_ENABLE
  21. extern PikaMemInfo g_PikaMemInfo;
  22. #if PIKA_GC_MARK_SWEEP_ENABLE
  23. extern PikaObjState g_PikaObjState;
  24. printf("[ GC]: object num max: %d, last GC: %d\r\n",
  25. g_PikaObjState.objCntMax, g_PikaObjState.objCntLastGC);
  26. #endif
  27. printf("[ Info]: alloc times: %d, cached times: %d (%0.2f%%)\r\n",
  28. g_PikaMemInfo.alloc_times, g_PikaMemInfo.alloc_times_cache,
  29. ((float)g_PikaMemInfo.alloc_times_cache /
  30. (float)g_PikaMemInfo.alloc_times) *
  31. 100.0);
  32. #endif
  33. return res;
  34. }