Move ComputeTest,GraphicsTest,RenderTest and Std140Debug to the tests folder

Also renamed NazaraUnitTests to UnitTests
This commit is contained in:
SirLynix 2022-12-26 08:44:11 +01:00
parent fe8715f1fb
commit 4b804dc613
71 changed files with 33 additions and 36 deletions

View File

@ -106,14 +106,14 @@ jobs:
- name: Run unit tests and generate coverage output (Linux) - name: Run unit tests and generate coverage output (Linux)
if: runner.os == 'Linux' if: runner.os == 'Linux'
run: | run: |
xmake run NazaraUnitTests xmake run UnitTests
gcovr -x coverage.out -s -f 'include/Nazara/.*' -f 'src/Nazara/.*' build/.objs/ gcovr -x coverage.out -s -f 'include/Nazara/.*' -f 'src/Nazara/.*' build/.objs/
- name: Run unit tests and generate coverage output (Windows) - name: Run unit tests and generate coverage output (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
shell: cmd shell: cmd
run: | run: |
"C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" --export_type cobertura:coverage.out --sources "NazaraEngine\include\Nazara\*" --sources "NazaraEngine\src\Nazara\*" --modules "NazaraEngine\bin\*" --cover_children -- xmake run NazaraUnitTests "C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" --export_type cobertura:coverage.out --sources "NazaraEngine\include\Nazara\*" --sources "NazaraEngine\src\Nazara\*" --modules "NazaraEngine\bin\*" --cover_children -- xmake run UnitTests
- name: Upload Coverage Report to Codecov - name: Upload Coverage Report to Codecov
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3

View File

@ -79,7 +79,7 @@ jobs:
# Run unit tests # Run unit tests
- name: Run unit tests - name: Run unit tests
if: matrix.mode != 'releasedbg' if: matrix.mode != 'releasedbg'
run: xmake run NazaraUnitTests run: xmake run UnitTests
# Setup installation configuration # Setup installation configuration
- name: Configure xmake for installation - name: Configure xmake for installation

View File

@ -72,7 +72,7 @@ jobs:
# Run unit tests # Run unit tests
- name: Run unit tests - name: Run unit tests
if: matrix.mode != 'releasedbg' if: matrix.mode != 'releasedbg'
run: xmake run NazaraUnitTests run: xmake run UnitTests
# Setup installation configuration # Setup installation configuration
- name: Configure xmake for installation - name: Configure xmake for installation

View File

@ -102,7 +102,7 @@ jobs:
# Run unit tests # Run unit tests
- name: Run unit tests - name: Run unit tests
if: matrix.mode != 'releasedbg' if: matrix.mode != 'releasedbg'
run: xmake run NazaraUnitTests run: xmake run UnitTests
# Setup installation configuration # Setup installation configuration
- name: Configure xmake for installation - name: Configure xmake for installation

View File

@ -73,7 +73,7 @@ jobs:
# Run unit tests # Run unit tests
- name: Run unit tests - name: Run unit tests
if: matrix.mode != 'releasedbg' if: matrix.mode != 'releasedbg'
run: xmake run NazaraUnitTests run: xmake run UnitTests
# Setup installation configuration # Setup installation configuration
- name: Configure xmake for installation - name: Configure xmake for installation

View File

@ -1,9 +1,7 @@
option("examples", { description = "Build examples", default = true }) option("examples", { description = "Build examples", default = true })
if has_config("examples") then if has_config("examples") then
-- Common config
set_group("Examples") set_group("Examples")
set_kind("binary")
includes("*/xmake.lua") includes("*/xmake.lua")
end end

25
tests/UnitTests/xmake.lua Normal file
View File

@ -0,0 +1,25 @@
add_requires("catch2 >=3.x")
if is_mode("asan") then
add_defines("CATCH_CONFIG_NO_WINDOWS_SEH")
add_defines("CATCH_CONFIG_NO_POSIX_SIGNALS")
end
add_deps("NazaraAudio", "NazaraCore", "NazaraNetwork", "NazaraPhysics2D")
add_packages("catch2", "entt")
add_headerfiles("Engine/**.hpp", { prefixdir = "private", install = false })
add_files("resources.cpp")
add_files("Engine/**.cpp")
add_includedirs(".")
if has_config("unitybuild") then
add_rules("c++.unity_build")
end
target("UnitTests", function ()
add_files("main.cpp", {unity_ignored = true})
if has_config("usepch") then
set_pcxxheader("Engine/Modules.hpp")
end
end)

View File

@ -1,33 +1,7 @@
option("tests", { description = "Build unit tests", default = false }) option("tests", { description = "Build tests", default = true })
if has_config("tests") then if has_config("tests") then
if is_mode("asan") then
add_defines("CATCH_CONFIG_NO_WINDOWS_SEH")
add_defines("CATCH_CONFIG_NO_POSIX_SIGNALS")
end
add_requires("catch2 3")
-- Common config
set_group("Tests") set_group("Tests")
set_kind("binary")
add_deps("NazaraAudio", "NazaraCore", "NazaraNetwork", "NazaraPhysics2D") includes("*/xmake.lua")
add_packages("catch2", "entt")
add_headerfiles("Engine/**.hpp", { prefixdir = "private", install = false })
add_files("resources.cpp")
add_files("Engine/**.cpp")
add_includedirs(".")
if has_config("unitybuild") then
add_rules("c++.unity_build")
end
target("NazaraUnitTests", function ()
add_files("main.cpp", {unity_ignored = true})
if has_config("usepch") then
set_pcxxheader("Engine/Modules.hpp")
end
end)
end end