main.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // SexyKanjiTestSuite.cpp : Defines the entry point for the console application.
  2. //
  3. #include "MiniCppUnit.hxx"
  4. #ifdef WIN32
  5. #include <direct.h>
  6. #else
  7. #include <unistd.h>
  8. #endif // WIN32
  9. #include <ctime>
  10. #include "KString.h"
  11. #include "spine/extension.h"
  12. #include "spine/spine.h"
  13. #include "KMemory.h" // last include
  14. void RegisterMemoryLeakDetector()
  15. {
  16. // Register our malloc and free functions to track memory leaks
  17. #ifdef KANJI_MEMTRACE
  18. _setDebugMalloc(_kanjimalloc);
  19. #endif
  20. _setMalloc(_kanjimalloc);
  21. _setFree(_kanjifree);
  22. }
  23. int main(int argc, char* argv[])
  24. {
  25. RegisterMemoryLeakDetector();
  26. // Start Timing
  27. time_t start_time, end_time;
  28. time(&start_time);
  29. /* Set working directory to current location for opening test data */
  30. #ifdef WIN32
  31. _chdir( GetFileDir(argv[0], false).c_str() );
  32. #else
  33. chdir(GetFileDir(argv[0], false).c_str());
  34. #endif
  35. // Run Test Suite
  36. if(JetBrains::underTeamcity()) gTeamCityListener.startSuite("Spine-C Test Suite");
  37. int ret_val = TestFixtureFactory::theInstance().runTests() ? 0 : -1;
  38. if(JetBrains::underTeamcity()) gTeamCityListener.endSuite("Spine-C Test Suite");
  39. // End Timing
  40. time(&end_time);
  41. double secs = difftime(end_time,start_time);
  42. printf("\n\n%i minutes and %i seconds of your life taken from you by these tests.\n", ((int)secs) / 60, ((int)secs) % 60);
  43. spAnimationState_disposeStatics(); // Fix for #775
  44. return ret_val;
  45. }
  46. extern "C" { // probably unnecessary
  47. void _spAtlasPage_createTexture(spAtlasPage* self, const char* path) {
  48. self->rendererObject = nullptr;
  49. self->width = 2048;
  50. self->height = 2048;
  51. }
  52. void _spAtlasPage_disposeTexture(spAtlasPage* self) {
  53. }
  54. char* _spUtil_readFile(const char* path, int* length) {
  55. return _readFile(path, length);
  56. }
  57. }