2
0

Main.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. #include "../../include/assimp/DefaultLogger.hpp"
  2. #include "UnitTestPCH.h"
  3. #include <ctime>
  4. int main(int argc, char *argv[]) {
  5. ::testing::InitGoogleTest(&argc, argv);
  6. // seed the randomizer with the current system time
  7. time_t t;
  8. time(&t);
  9. srand((unsigned int)t);
  10. // ............................................................................
  11. // create a logger from both CPP
  12. Assimp::DefaultLogger::create("AssimpLog_Cpp.log", Assimp::Logger::VERBOSE,
  13. aiDefaultLogStream_STDOUT | aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE);
  14. // .. and C. They should smoothly work together
  15. aiEnableVerboseLogging(AI_TRUE);
  16. aiLogStream logstream = aiGetPredefinedLogStream(aiDefaultLogStream_FILE, "AssimpLog_C.log");
  17. aiAttachLogStream(&logstream);
  18. int result = RUN_ALL_TESTS();
  19. // ............................................................................
  20. // but shutdown must be done from C to ensure proper deallocation
  21. aiDetachAllLogStreams();
  22. return result;
  23. }