test_main.cpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*************************************************************************/
  2. /* test_main.cpp */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* http://www.godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
  9. /* */
  10. /* Permission is hereby granted, free of charge, to any person obtaining */
  11. /* a copy of this software and associated documentation files (the */
  12. /* "Software"), to deal in the Software without restriction, including */
  13. /* without limitation the rights to use, copy, modify, merge, publish, */
  14. /* distribute, sublicense, and/or sell copies of the Software, and to */
  15. /* permit persons to whom the Software is furnished to do so, subject to */
  16. /* the following conditions: */
  17. /* */
  18. /* The above copyright notice and this permission notice shall be */
  19. /* included in all copies or substantial portions of the Software. */
  20. /* */
  21. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  22. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  23. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  24. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  25. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  26. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  27. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  28. /*************************************************************************/
  29. #include "list.h"
  30. #include "os/main_loop.h"
  31. #ifdef DEBUG_ENABLED
  32. #include "test_string.h"
  33. #include "test_containers.h"
  34. #include "test_math.h"
  35. #include "test_gui.h"
  36. #include "test_render.h"
  37. #include "test_sound.h"
  38. #include "test_misc.h"
  39. #include "test_physics.h"
  40. #include "test_physics_2d.h"
  41. #include "test_python.h"
  42. #include "test_io.h"
  43. #include "test_particles.h"
  44. #include "test_detailer.h"
  45. #include "test_shader_lang.h"
  46. #include "test_gdscript.h"
  47. #include "test_image.h"
  48. const char ** tests_get_names() {
  49. static const char* test_names[]={
  50. "string",
  51. "containers",
  52. "math",
  53. "render",
  54. "particles",
  55. "multimesh",
  56. "gui",
  57. "io",
  58. "shaderlang",
  59. NULL
  60. };
  61. return test_names;
  62. }
  63. MainLoop* test_main(String p_test,const List<String>& p_args) {
  64. if (p_test=="string") {
  65. return TestString::test();
  66. }
  67. if (p_test=="containers") {
  68. return TestContainers::test();
  69. }
  70. if (p_test=="math") {
  71. return TestMath::test();
  72. }
  73. if (p_test=="physics") {
  74. return TestPhysics::test();
  75. }
  76. if (p_test=="physics_2d") {
  77. return TestPhysics2D::test();
  78. }
  79. if (p_test=="misc") {
  80. return TestMisc::test();
  81. }
  82. if (p_test=="render") {
  83. return TestRender::test();
  84. }
  85. #ifndef _3D_DISABLED
  86. if (p_test=="gui") {
  87. return TestGUI::test();
  88. }
  89. #endif
  90. if (p_test=="sound") {
  91. return TestSound::test();
  92. }
  93. if (p_test=="io") {
  94. return TestIO::test();
  95. }
  96. if (p_test=="particles") {
  97. return TestParticles::test();
  98. }
  99. if (p_test=="multimesh") {
  100. return TestMultiMesh::test();
  101. }
  102. if (p_test=="shaderlang") {
  103. return TestShaderLang::test();
  104. }
  105. if (p_test=="gd_tokenizer") {
  106. return TestGDScript::test(TestGDScript::TEST_TOKENIZER);
  107. }
  108. if (p_test=="gd_parser") {
  109. return TestGDScript::test(TestGDScript::TEST_PARSER);
  110. }
  111. if (p_test=="gd_compiler") {
  112. return TestGDScript::test(TestGDScript::TEST_COMPILER);
  113. }
  114. if (p_test=="gd_bytecode") {
  115. return TestGDScript::test(TestGDScript::TEST_BYTECODE);
  116. }
  117. if (p_test=="image") {
  118. return TestImage::test();
  119. }
  120. if (p_test=="detailer") {
  121. return TestMultiMesh::test();
  122. }
  123. #ifdef PYTHON_ENABLED
  124. if (p_test=="python") {
  125. return TestPython::test();
  126. }
  127. #endif
  128. return NULL;
  129. }
  130. #else
  131. const char ** tests_get_names() {
  132. static const char* test_names[]={
  133. NULL
  134. };
  135. return test_names;
  136. }
  137. MainLoop* test_main(String p_test,const List<String>& p_args) {
  138. return NULL;
  139. }
  140. #endif