Skip to content

Commit

Permalink
refacctor: refacctoring test
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Aug 15, 2024
1 parent 3de7c25 commit 011b6ec
Show file tree
Hide file tree
Showing 32 changed files with 40 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,6 @@ fabric.properties
/site/

# Test
src/ll/test/include_all.cpp
src-test/**/include_all.cpp

/bin/
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src-test/ll/test/include_all.cpp

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "gtest/gtest.h"

#include "ll/test/Test.h"
#include "Test.h"

namespace ll::test {
class TestManager {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/mc/world/level/BlockPos.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
40 changes: 35 additions & 5 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 011b6ec

Please sign in to comment.