Main.cpp 2.0 KB

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