Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests #1862

Merged
merged 8 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
arch: 'x64'
- name: Build
shell: pwsh
run: .\tools\cmdline\build.ps1 -p win32 -a x64
run: |
.\tools\cmdline\build.ps1 -p win32 -a x64
.\tools\cmdline\build.ps1 -p win32 -a x64 -xb '--target,unit-tests'
win32-dll:
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -67,17 +69,17 @@ jobs:
runs-on: windows-latest
env:
# Test winsdk < 10.0.22000.0 (missing C11 standard stdalign.h), axmol will auto fallback to C99 for resolving compiling issue.
WINSDK_VER: '10.0.19041.0'
WINSDK_VER: '10.0.19041.0'
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "16.0"

- name: Build
shell: pwsh
run: .\tools\cmdline\build.ps1 -p win32 -a 'x64' -cc clang -sdk $env:WINSDK_VER
Expand All @@ -98,6 +100,7 @@ jobs:
run: |
./tools/cmdline/build.ps1 -p linux -a x64
./tools/cmdline/build.ps1 -p linux -a x64 -xb '--target,lua-tests'
./tools/cmdline/build.ps1 -p linux -a x64 -xb '--target,unit-tests'
osx:
runs-on: macos-13
strategy:
Expand All @@ -113,7 +116,9 @@ jobs:
submodules: 'recursive'
- name: Build
shell: pwsh
run: ./tools/cmdline/build.ps1 -p osx -a $env:BUILD_ARCH
run: |
./tools/cmdline/build.ps1 -p osx -a $env:BUILD_ARCH
./tools/cmdline/build.ps1 -p osx -a $env:BUILD_ARCH -xb '--target,unit-tests'
android:
runs-on: ubuntu-latest
strategy:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ tests/lua-tests/Content/res
tests/cpp-tests/Content
tests/fairygui-tests/Content
tests/live2d-tests/Content
tests/unit-tests/Content
*.patch

/cache
Expand Down
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,22 @@ if(AX_BUILD_TESTS)

# add cpp tests default
add_test_target(cpp-tests ${_AX_ROOT}/tests/cpp-tests)


if(LINUX OR MACOSX OR WINDOWS)
add_test_target(unit-tests ${_AX_ROOT}/tests/unit-tests)
endif()

# add fairygui tests when fairygui extension is enabled
if(AX_ENABLE_EXT_FAIRYGUI)
add_test_target(fairygui-tests ${_AX_ROOT}/tests/fairygui-tests)
endif()

if(AX_ENABLE_EXT_LIVE2D)
add_test_target(live2d-tests ${_AX_ROOT}/tests/live2d-tests)
endif()

if(AX_ENABLE_EXT_LUA)
add_test_target(lua-tests ${_AX_ROOT}/tests/lua-tests)
endif(AX_ENABLE_EXT_LUA)

endif()
6 changes: 0 additions & 6 deletions tests/cpp-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ list(APPEND GAME_HEADER
Source/testBasic.h
Source/ZwoptexTest/ZwoptexTest.h
Source/CurlTest/CurlTest.h
Source/UnitTest/UnitTest.h
# Source/UnitTest/RefPtrTest.h
Source/ConfigurationTest/ConfigurationTest.h
Source/CurrentLanguageTest/CurrentLanguageTest.h
Source/AppDelegate.h
Expand Down Expand Up @@ -236,7 +234,6 @@ list(APPEND GAME_HEADER
Source/SpritePolygonTest/SpritePolygonTest.h
Source/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.h
Source/NodeTest/NodeTest.h
Source/FileUtilsTest/FileUtilsTest.h
Source/RenderTextureTest/RenderTextureTest.h
Source/LayerTest/LayerTest.h
Source/SpriteTest/SpriteTest.h
Expand Down Expand Up @@ -297,7 +294,6 @@ list(APPEND GAME_SOURCE
Source/ExtensionsTest/ExtensionsTest.cpp
Source/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp
Source/ExtensionsTest/TableViewTest/TableViewTestScene.cpp
Source/FileUtilsTest/FileUtilsTest.cpp
Source/FontTest/FontTest.cpp
Source/InputTest/MouseTest.cpp
Source/IntervalTest/IntervalTest.cpp
Expand Down Expand Up @@ -364,8 +360,6 @@ list(APPEND GAME_SOURCE
Source/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp
Source/UITest/CocoStudioGUITest/UITabControlTest/UITabControlTest.cpp
Source/UITest/UITest.cpp
# Source/UnitTest/RefPtrTest.cpp
Source/UnitTest/UnitTest.cpp
Source/UserDefaultTest/UserDefaultTest.cpp
Source/ImGuiTest/ImGuiTest.cpp
Source/VisibleRect.cpp
Expand Down
Loading
Loading