From 9f649efe5d2595977d429625cca30ff7704c0a59 Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Sun, 26 Jul 2020 00:06:07 +0300 Subject: [PATCH] Move `tests` to the top-level directory --- SConstruct | 7 ++++--- main/SCsub | 3 --- main/main.cpp | 2 +- {main/tests => tests}/SCsub | 0 {main/tests => tests}/test_astar.cpp | 0 {main/tests => tests}/test_astar.h | 0 {main/tests => tests}/test_basis.cpp | 0 {main/tests => tests}/test_basis.h | 0 {main/tests => tests}/test_class_db.cpp | 0 {main/tests => tests}/test_class_db.h | 0 {main/tests => tests}/test_gdscript.cpp | 0 {main/tests => tests}/test_gdscript.h | 0 {main/tests => tests}/test_gui.cpp | 0 {main/tests => tests}/test_gui.h | 0 {main/tests => tests}/test_main.cpp | 0 {main/tests => tests}/test_main.h | 0 {main/tests => tests}/test_math.cpp | 0 {main/tests => tests}/test_math.h | 0 {main/tests => tests}/test_oa_hash_map.cpp | 0 {main/tests => tests}/test_oa_hash_map.h | 0 {main/tests => tests}/test_ordered_hash_map.cpp | 0 {main/tests => tests}/test_ordered_hash_map.h | 0 {main/tests => tests}/test_physics_2d.cpp | 0 {main/tests => tests}/test_physics_2d.h | 0 {main/tests => tests}/test_physics_3d.cpp | 0 {main/tests => tests}/test_physics_3d.h | 0 {main/tests => tests}/test_render.cpp | 0 {main/tests => tests}/test_render.h | 0 {main/tests => tests}/test_shader_lang.cpp | 0 {main/tests => tests}/test_shader_lang.h | 0 {main/tests => tests}/test_string.h | 0 {main/tests => tests}/test_validate_testing.h | 0 32 files changed, 5 insertions(+), 7 deletions(-) rename {main/tests => tests}/SCsub (100%) rename {main/tests => tests}/test_astar.cpp (100%) rename {main/tests => tests}/test_astar.h (100%) rename {main/tests => tests}/test_basis.cpp (100%) rename {main/tests => tests}/test_basis.h (100%) rename {main/tests => tests}/test_class_db.cpp (100%) rename {main/tests => tests}/test_class_db.h (100%) rename {main/tests => tests}/test_gdscript.cpp (100%) rename {main/tests => tests}/test_gdscript.h (100%) rename {main/tests => tests}/test_gui.cpp (100%) rename {main/tests => tests}/test_gui.h (100%) rename {main/tests => tests}/test_main.cpp (100%) rename {main/tests => tests}/test_main.h (100%) rename {main/tests => tests}/test_math.cpp (100%) rename {main/tests => tests}/test_math.h (100%) rename {main/tests => tests}/test_oa_hash_map.cpp (100%) rename {main/tests => tests}/test_oa_hash_map.h (100%) rename {main/tests => tests}/test_ordered_hash_map.cpp (100%) rename {main/tests => tests}/test_ordered_hash_map.h (100%) rename {main/tests => tests}/test_physics_2d.cpp (100%) rename {main/tests => tests}/test_physics_2d.h (100%) rename {main/tests => tests}/test_physics_3d.cpp (100%) rename {main/tests => tests}/test_physics_3d.h (100%) rename {main/tests => tests}/test_render.cpp (100%) rename {main/tests => tests}/test_render.h (100%) rename {main/tests => tests}/test_shader_lang.cpp (100%) rename {main/tests => tests}/test_shader_lang.h (100%) rename {main/tests => tests}/test_string.h (100%) rename {main/tests => tests}/test_validate_testing.h (100%) diff --git a/SConstruct b/SConstruct index debae3c9df1..98438d2c600 100644 --- a/SConstruct +++ b/SConstruct @@ -661,8 +661,7 @@ if selected_platform in platform_list: Export("env") - # build subdirs, the build order is dependent on link order. - + # Build subdirs, the build order is dependent on link order. SConscript("core/SCsub") SConscript("servers/SCsub") SConscript("scene/SCsub") @@ -671,9 +670,11 @@ if selected_platform in platform_list: SConscript("platform/SCsub") SConscript("modules/SCsub") + if env["tests"]: + SConscript("tests/SCsub") SConscript("main/SCsub") - SConscript("platform/" + selected_platform + "/SCsub") # build selected platform + SConscript("platform/" + selected_platform + "/SCsub") # Build selected platform. # Microsoft Visual Studio Project Generation if env["vsproj"]: diff --git a/main/SCsub b/main/SCsub index 793e5ed8276..152d0c4d033 100644 --- a/main/SCsub +++ b/main/SCsub @@ -20,8 +20,5 @@ env.CommandNoCache( env.Depends("#main/app_icon.gen.h", "#main/app_icon.png") env.CommandNoCache("#main/app_icon.gen.h", "#main/app_icon.png", run_in_subprocess(main_builders.make_app_icon)) -if env["tests"]: - SConscript("tests/SCsub") - lib = env.add_library("main", env.main_sources) env.Prepend(LIBS=[lib]) diff --git a/main/main.cpp b/main/main.cpp index fad85ddf515..6965e5415a7 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -75,7 +75,7 @@ #include "servers/xr_server.h" #ifdef TESTS_ENABLED -#include "main/tests/test_main.h" +#include "tests/test_main.h" #endif #ifdef TOOLS_ENABLED diff --git a/main/tests/SCsub b/tests/SCsub similarity index 100% rename from main/tests/SCsub rename to tests/SCsub diff --git a/main/tests/test_astar.cpp b/tests/test_astar.cpp similarity index 100% rename from main/tests/test_astar.cpp rename to tests/test_astar.cpp diff --git a/main/tests/test_astar.h b/tests/test_astar.h similarity index 100% rename from main/tests/test_astar.h rename to tests/test_astar.h diff --git a/main/tests/test_basis.cpp b/tests/test_basis.cpp similarity index 100% rename from main/tests/test_basis.cpp rename to tests/test_basis.cpp diff --git a/main/tests/test_basis.h b/tests/test_basis.h similarity index 100% rename from main/tests/test_basis.h rename to tests/test_basis.h diff --git a/main/tests/test_class_db.cpp b/tests/test_class_db.cpp similarity index 100% rename from main/tests/test_class_db.cpp rename to tests/test_class_db.cpp diff --git a/main/tests/test_class_db.h b/tests/test_class_db.h similarity index 100% rename from main/tests/test_class_db.h rename to tests/test_class_db.h diff --git a/main/tests/test_gdscript.cpp b/tests/test_gdscript.cpp similarity index 100% rename from main/tests/test_gdscript.cpp rename to tests/test_gdscript.cpp diff --git a/main/tests/test_gdscript.h b/tests/test_gdscript.h similarity index 100% rename from main/tests/test_gdscript.h rename to tests/test_gdscript.h diff --git a/main/tests/test_gui.cpp b/tests/test_gui.cpp similarity index 100% rename from main/tests/test_gui.cpp rename to tests/test_gui.cpp diff --git a/main/tests/test_gui.h b/tests/test_gui.h similarity index 100% rename from main/tests/test_gui.h rename to tests/test_gui.h diff --git a/main/tests/test_main.cpp b/tests/test_main.cpp similarity index 100% rename from main/tests/test_main.cpp rename to tests/test_main.cpp diff --git a/main/tests/test_main.h b/tests/test_main.h similarity index 100% rename from main/tests/test_main.h rename to tests/test_main.h diff --git a/main/tests/test_math.cpp b/tests/test_math.cpp similarity index 100% rename from main/tests/test_math.cpp rename to tests/test_math.cpp diff --git a/main/tests/test_math.h b/tests/test_math.h similarity index 100% rename from main/tests/test_math.h rename to tests/test_math.h diff --git a/main/tests/test_oa_hash_map.cpp b/tests/test_oa_hash_map.cpp similarity index 100% rename from main/tests/test_oa_hash_map.cpp rename to tests/test_oa_hash_map.cpp diff --git a/main/tests/test_oa_hash_map.h b/tests/test_oa_hash_map.h similarity index 100% rename from main/tests/test_oa_hash_map.h rename to tests/test_oa_hash_map.h diff --git a/main/tests/test_ordered_hash_map.cpp b/tests/test_ordered_hash_map.cpp similarity index 100% rename from main/tests/test_ordered_hash_map.cpp rename to tests/test_ordered_hash_map.cpp diff --git a/main/tests/test_ordered_hash_map.h b/tests/test_ordered_hash_map.h similarity index 100% rename from main/tests/test_ordered_hash_map.h rename to tests/test_ordered_hash_map.h diff --git a/main/tests/test_physics_2d.cpp b/tests/test_physics_2d.cpp similarity index 100% rename from main/tests/test_physics_2d.cpp rename to tests/test_physics_2d.cpp diff --git a/main/tests/test_physics_2d.h b/tests/test_physics_2d.h similarity index 100% rename from main/tests/test_physics_2d.h rename to tests/test_physics_2d.h diff --git a/main/tests/test_physics_3d.cpp b/tests/test_physics_3d.cpp similarity index 100% rename from main/tests/test_physics_3d.cpp rename to tests/test_physics_3d.cpp diff --git a/main/tests/test_physics_3d.h b/tests/test_physics_3d.h similarity index 100% rename from main/tests/test_physics_3d.h rename to tests/test_physics_3d.h diff --git a/main/tests/test_render.cpp b/tests/test_render.cpp similarity index 100% rename from main/tests/test_render.cpp rename to tests/test_render.cpp diff --git a/main/tests/test_render.h b/tests/test_render.h similarity index 100% rename from main/tests/test_render.h rename to tests/test_render.h diff --git a/main/tests/test_shader_lang.cpp b/tests/test_shader_lang.cpp similarity index 100% rename from main/tests/test_shader_lang.cpp rename to tests/test_shader_lang.cpp diff --git a/main/tests/test_shader_lang.h b/tests/test_shader_lang.h similarity index 100% rename from main/tests/test_shader_lang.h rename to tests/test_shader_lang.h diff --git a/main/tests/test_string.h b/tests/test_string.h similarity index 100% rename from main/tests/test_string.h rename to tests/test_string.h diff --git a/main/tests/test_validate_testing.h b/tests/test_validate_testing.h similarity index 100% rename from main/tests/test_validate_testing.h rename to tests/test_validate_testing.h