Main.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #include "math/Vector.h"
  2. #include "rendering/Framebuffer.h"
  3. #include "rendering/GL.h"
  4. #include "rendering/Window.h"
  5. #include "tests/ArrayListTests.h"
  6. #include "tests/ArrayTests.h"
  7. #include "tests/BitArrayTests.h"
  8. #include "tests/BufferTests.h"
  9. #include "tests/ClockTests.h"
  10. #include "tests/ColorTests.h"
  11. #include "tests/ComponentsTests.h"
  12. #include "tests/FrustumTests.h"
  13. #include "tests/HashMapTests.h"
  14. #include "tests/ImageReaderTests.h"
  15. #include "tests/ListTests.h"
  16. #include "tests/MathTests.h"
  17. #include "tests/MatrixStackTests.h"
  18. #include "tests/MatrixTests.h"
  19. #include "tests/NetworkTests.h"
  20. #include "tests/PlaneTests.h"
  21. #include "tests/QuaternionTests.h"
  22. #include "tests/RandomTests.h"
  23. #include "tests/RingBufferTests.h"
  24. #include "tests/SplitStringTests.h"
  25. #include "tests/StackTests.h"
  26. #include "tests/StringBufferTests.h"
  27. #include "tests/TypedBufferTests.h"
  28. #include "tests/UniquePointerTests.h"
  29. #include "tests/VectorTests.h"
  30. #include "utils/Logger.h"
  31. static int ticks = 40;
  32. static bool isRunning() {
  33. return !Window::shouldClose() && ticks > 0;
  34. }
  35. static void tick() {
  36. ticks -= ticks > 0;
  37. }
  38. static void render(float) {
  39. }
  40. int main(int argAmount, char** args) {
  41. if(argAmount < 2) {
  42. LOG_ERROR("missing path to images");
  43. return 0;
  44. }
  45. ArrayTests::test();
  46. ArrayListTests::test();
  47. HashMapTests::test();
  48. ListTests::test();
  49. BitArrayTests::test();
  50. StringBufferTests::test();
  51. RandomTests::test();
  52. RingBufferTests::test();
  53. SplitStringTests::test();
  54. VectorTests::test();
  55. MatrixTests::test();
  56. StackTests::test();
  57. MatrixStackTests::test();
  58. PlaneTests::test();
  59. FrustumTests::test();
  60. QuaternionTests::test();
  61. MathTests::test();
  62. ColorTests::test();
  63. ClockTests::test();
  64. ImageReaderTests::test(args[1]);
  65. BufferTests::test();
  66. TypedBufferTests::test();
  67. UniquePointerTests::test();
  68. NetworkTests::test();
  69. ComponentsTests::test();
  70. Window::Options options(4, 3, {800, 480}, false, "Test");
  71. Error error = Window::open(options);
  72. if(error.has()) {
  73. LOG_ERROR(error.message);
  74. return 0;
  75. }
  76. Window::show();
  77. Window::run<isRunning, tick, render>(50'000'000);
  78. Window::close();
  79. GL::printError("WUSI");
  80. return 0;
  81. }