diff --git a/.gitignore b/.gitignore index b90858cf5a..e56610aeff 100644 --- a/.gitignore +++ b/.gitignore @@ -559,6 +559,6 @@ fabric.properties /site/ # Test -src/ll/test/include_all.cpp +src-test/**/include_all.cpp /bin/ diff --git a/src-client/ll/Versions.cpp b/src-client/ll/api/Versions.cpp similarity index 100% rename from src-client/ll/Versions.cpp rename to src-client/ll/api/Versions.cpp diff --git a/src-client/ll/test/jsonUITest.cpp b/src-test/client/jsonUITest.cpp similarity index 100% rename from src-client/ll/test/jsonUITest.cpp rename to src-test/client/jsonUITest.cpp diff --git a/src-test/ll/test/include_all.cpp b/src-test/ll/test/include_all.cpp deleted file mode 100644 index 81272ce8a9..0000000000 --- a/src-test/ll/test/include_all.cpp +++ /dev/null @@ -1 +0,0 @@ -// auto gen when build test diff --git a/src-test/ll/test/ConfigTest.cpp b/src-test/server/ConfigTest.cpp similarity index 100% rename from src-test/ll/test/ConfigTest.cpp rename to src-test/server/ConfigTest.cpp diff --git a/src-test/ll/test/ECSTest.cpp b/src-test/server/ECSTest.cpp similarity index 100% rename from src-test/ll/test/ECSTest.cpp rename to src-test/server/ECSTest.cpp diff --git a/src-test/ll/test/EventTest.cpp b/src-test/server/EventTest.cpp similarity index 100% rename from src-test/ll/test/EventTest.cpp rename to src-test/server/EventTest.cpp diff --git a/src-test/ll/test/FormTest.cpp b/src-test/server/FormTest.cpp similarity index 100% rename from src-test/ll/test/FormTest.cpp rename to src-test/server/FormTest.cpp diff --git a/src-test/ll/test/HookTest.cpp b/src-test/server/HookTest.cpp similarity index 100% rename from src-test/ll/test/HookTest.cpp rename to src-test/server/HookTest.cpp diff --git a/src-test/ll/test/ModRegisterTest.cpp b/src-test/server/ModRegisterTest.cpp similarity index 100% rename from src-test/ll/test/ModRegisterTest.cpp rename to src-test/server/ModRegisterTest.cpp diff --git a/src-test/ll/test/Packet_test.cpp b/src-test/server/Packet_test.cpp similarity index 100% rename from src-test/ll/test/Packet_test.cpp rename to src-test/server/Packet_test.cpp diff --git a/src-test/ll/test/PtrTest.cpp b/src-test/server/PtrTest.cpp similarity index 100% rename from src-test/ll/test/PtrTest.cpp rename to src-test/server/PtrTest.cpp diff --git a/src-test/ll/test/RecipesTest.cpp b/src-test/server/RecipesTest.cpp similarity index 100% rename from src-test/ll/test/RecipesTest.cpp rename to src-test/server/RecipesTest.cpp diff --git a/src-test/ll/test/ScheduleTest.cpp b/src-test/server/ScheduleTest.cpp similarity index 100% rename from src-test/ll/test/ScheduleTest.cpp rename to src-test/server/ScheduleTest.cpp diff --git a/src-test/ll/test/ServiceTest.cpp b/src-test/server/ServiceTest.cpp similarity index 100% rename from src-test/ll/test/ServiceTest.cpp rename to src-test/server/ServiceTest.cpp diff --git a/src-test/ll/test/Test.cpp b/src-test/server/Test.cpp similarity index 100% rename from src-test/ll/test/Test.cpp rename to src-test/server/Test.cpp diff --git a/src-test/ll/test/Test.h b/src-test/server/Test.h similarity index 100% rename from src-test/ll/test/Test.h rename to src-test/server/Test.h diff --git a/src-test/ll/test/TestCustomDimension.cpp b/src-test/server/TestCustomDimension.cpp similarity index 100% rename from src-test/ll/test/TestCustomDimension.cpp rename to src-test/server/TestCustomDimension.cpp diff --git a/src-test/ll/test/TestDataItem.cpp b/src-test/server/TestDataItem.cpp similarity index 100% rename from src-test/ll/test/TestDataItem.cpp rename to src-test/server/TestDataItem.cpp diff --git a/src-test/ll/test/TestManager.cpp b/src-test/server/TestManager.cpp similarity index 100% rename from src-test/ll/test/TestManager.cpp rename to src-test/server/TestManager.cpp diff --git a/src-test/ll/test/TestManager.h b/src-test/server/TestManager.h similarity index 97% rename from src-test/ll/test/TestManager.h rename to src-test/server/TestManager.h index c1d328c3cc..16169a9411 100644 --- a/src-test/ll/test/TestManager.h +++ b/src-test/server/TestManager.h @@ -5,7 +5,7 @@ #include "gtest/gtest.h" -#include "ll/test/Test.h" +#include "Test.h" namespace ll::test { class TestManager { diff --git a/src-test/ll/test/TestMolang.cpp b/src-test/server/TestMolang.cpp similarity index 100% rename from src-test/ll/test/TestMolang.cpp rename to src-test/server/TestMolang.cpp diff --git a/src-test/ll/test/TestNbt.cpp b/src-test/server/TestNbt.cpp similarity index 100% rename from src-test/ll/test/TestNbt.cpp rename to src-test/server/TestNbt.cpp diff --git a/src-test/ll/test/Test_unittest.cpp b/src-test/server/Test_unittest.cpp similarity index 90% rename from src-test/ll/test/Test_unittest.cpp rename to src-test/server/Test_unittest.cpp index cd3467cd0b..15519661dc 100644 --- a/src-test/ll/test/Test_unittest.cpp +++ b/src-test/server/Test_unittest.cpp @@ -1,7 +1,7 @@ #include "gtest/gtest.h" -#include "ll/test/Test.h" -#include "ll/test/TestManager.h" +#include "Test.h" +#include "TestManager.h" namespace { diff --git a/src-test/ll/test/customWorldGenerator/FlatWorldGeneratorOptions.json b/src-test/server/customWorldGenerator/FlatWorldGeneratorOptions.json similarity index 100% rename from src-test/ll/test/customWorldGenerator/FlatWorldGeneratorOptions.json rename to src-test/server/customWorldGenerator/FlatWorldGeneratorOptions.json diff --git a/src-test/ll/test/customWorldGenerator/McClassMembersTests/FeatureMembersTest.cpp b/src-test/server/customWorldGenerator/McClassMembersTests/FeatureMembersTest.cpp similarity index 100% rename from src-test/ll/test/customWorldGenerator/McClassMembersTests/FeatureMembersTest.cpp rename to src-test/server/customWorldGenerator/McClassMembersTests/FeatureMembersTest.cpp diff --git a/src-test/ll/test/customWorldGenerator/McClassMembersTests/FlatWorldGeneratorOptionsMembersTest.cpp b/src-test/server/customWorldGenerator/McClassMembersTests/FlatWorldGeneratorOptionsMembersTest.cpp similarity index 100% rename from src-test/ll/test/customWorldGenerator/McClassMembersTests/FlatWorldGeneratorOptionsMembersTest.cpp rename to src-test/server/customWorldGenerator/McClassMembersTests/FlatWorldGeneratorOptionsMembersTest.cpp diff --git a/src-test/ll/test/customWorldGenerator/MyWorldGenerator.cpp b/src-test/server/customWorldGenerator/MyWorldGenerator.cpp similarity index 100% rename from src-test/ll/test/customWorldGenerator/MyWorldGenerator.cpp rename to src-test/server/customWorldGenerator/MyWorldGenerator.cpp diff --git a/src-test/ll/test/customWorldGenerator/TestWorldGenerator.cpp b/src-test/server/customWorldGenerator/TestWorldGenerator.cpp similarity index 100% rename from src-test/ll/test/customWorldGenerator/TestWorldGenerator.cpp rename to src-test/server/customWorldGenerator/TestWorldGenerator.cpp diff --git a/src-test/ll/test/testCommand.cpp b/src-test/server/testCommand.cpp similarity index 100% rename from src-test/ll/test/testCommand.cpp rename to src-test/server/testCommand.cpp diff --git a/src/mc/world/level/BlockPos.h b/src/mc/world/level/BlockPos.h index dc321b6895..88b8ec4912 100644 --- a/src/mc/world/level/BlockPos.h +++ b/src/mc/world/level/BlockPos.h @@ -1,6 +1,7 @@ #pragma once #include "mc/_HeaderOutputPredefine.h" +#include "mc/world/level/ChunkPos.h" // auto generated inclusion list #include "mc/enums/Mirror.h" diff --git a/xmake.lua b/xmake.lua index bd57104a10..3ecaf4723c 100644 --- a/xmake.lua +++ b/xmake.lua @@ -175,25 +175,55 @@ target("LeviLamina") "src/ll/core/plugin-abi/**.cpp" -- "src/ll/core/tweak/ModifyMemoryAllocator.cpp" ) + add_cxflags("/wd4273") + add_shflags("/IGNORE:4217") end if has_config("tests") then add_defines("LL_DEBUG") add_packages("gtest") - add_includedirs("src-test") - add_files("src-test/ll/test/**.cpp") - + add_includedirs("src-test/common/") + add_files("src-test/common/**.cpp") + if is_config("target_type", "server") then + add_includedirs("src-test/server/") + add_files("src-test/server/**.cpp") + else + add_includedirs("src-test/client/") + add_files("src-test/client/**.cpp") + end before_build(function (target) headers = "" for _,x in ipairs(os.files("src/**.h")) do headers = headers.."#include \""..path.relative(x, "src/").."\"\n" end - file = io.open("src-test/ll/test/include_all.cpp", "w") + file = io.open("src-test/common/include_all.cpp", "w") + file:write(headers) + file:close() + if is_config("target_type", "server") then + headers = "" + for _,x in ipairs(os.files("src-server/**.h")) do + headers = headers.."#include \""..path.relative(x, "src-server/").."\"\n" + end + file = io.open("src-test/server/include_all.cpp", "w") file:write(headers) file:close() + else + headers = "" + for _,x in ipairs(os.files("src-client/**.h")) do + headers = headers.."#include \""..path.relative(x, "src-client/").."\"\n" + end + file = io.open("src-test/client/include_all.cpp", "w") + file:write(headers) + file:close() + end end) after_build(function (target) - io.writefile("src-test/ll/test/include_all.cpp", "// auto gen when build test\n") + io.writefile("src-test/common/include_all.cpp", "// auto gen when build test\n") + if is_config("target_type", "server") then + io.writefile("src-test/server/include_all.cpp", "// auto gen when build test\n") + else + io.writefile("src-test/client/include_all.cpp", "// auto gen when build test\n") + end end) end