Main.cpp 909 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <clocale>
  2. #include <cstdio>
  3. #include <cstring>
  4. #include <source_location>
  5. #include "Tests.hpp"
  6. import Core.Logger;
  7. import Core.Utility;
  8. import Core.Test;
  9. static void reportHandler(
  10. Core::LogLevel, const std::source_location&, void*, const char* message) {
  11. if(useReport) {
  12. Core::logError(message);
  13. }
  14. }
  15. int main(int argAmount, char** args) {
  16. if(argAmount >= 2 && strcmp(args[1], "help") == 0) {
  17. puts("test");
  18. return 0;
  19. }
  20. setlocale(LC_ALL, "en_US.utf8");
  21. Core::setReportHandler(reportHandler, nullptr);
  22. if(argAmount < 2) {
  23. Core::logError("missing mode");
  24. return 0;
  25. } else if(strcmp("test", args[1]) == 0) {
  26. testImageReader("test/resources");
  27. testNetwork();
  28. } else if(strcmp("window", args[1]) == 0) {
  29. testWindow();
  30. }
  31. Core::finalizeTests();
  32. Core::printMemoryReport();
  33. return 0;
  34. }