Main.cpp 2.3 KB

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