main.cpp 599 B

12345678910111213141516171819202122
  1. #include "gtest/gtest.h"
  2. #include "test_common.h"
  3. extern "C" {
  4. #include "dataMemory.h"
  5. #include "pika_config_gtest.h"
  6. }
  7. int main(int argc, char** argv) {
  8. ::testing::InitGoogleTest(&argc, argv);
  9. int res = RUN_ALL_TESTS();
  10. mem_pool_deinit();
  11. #if PIKA_ARG_CACHE_ENABLE
  12. extern PikaMemInfo pikaMemInfo;
  13. printf("[ Info]: alloc times: %d, cached times: %d (%0.2f%%)\r\n",
  14. pikaMemInfo.alloc_times, pikaMemInfo.alloc_times_cache,
  15. ((float)pikaMemInfo.alloc_times_cache /
  16. (float)pikaMemInfo.alloc_times) *
  17. 100.0);
  18. #endif
  19. return res;
  20. }