Main.cpp 2.4 KB

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