-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3b8dfe
commit 1fb7a11
Showing
10 changed files
with
246 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Run GTest Linux | ||
|
||
env: | ||
SDL_VIDEODRIVER: "dummy" | ||
SDL_AUDIODRIVER: "dummy" | ||
|
||
on: | ||
push: | ||
branches: [ "main", "**dev" ] | ||
pull_request: | ||
jobs: | ||
linux-gtest: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | ||
fail-fast: false | ||
# Set up a matrix to run the following 2 configurations: | ||
# 1. <Linux, latest GCC compiler toolchain on the default runner image, default generator> | ||
# 2. <Linux, latest Clang compiler toolchain on the default runner image, default generator> | ||
# | ||
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. | ||
matrix: | ||
os: [ubuntu-latest] | ||
c_compiler: [gcc, clang] | ||
include: | ||
- os: ubuntu-latest | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
- os: ubuntu-latest | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set reusable strings | ||
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
- name: Update packages | ||
run: sudo apt-get update && sudo apt-get upgrade -y | ||
- name: Install SDL2 dependency | ||
run: sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libgtest-dev -y | ||
- uses: actions/setup-python@v5 | ||
- name: Install meson | ||
run: python3 -m pip install meson ninja | ||
- name: Configure meson | ||
run: meson setup build -Dbuild_tests=true | ||
- name: Build test executable | ||
run: cd build && meson compile -j$(nproc) | ||
- name: Run Tests | ||
run: cd build && ./krakentests --gtest_shuffle --gtest_color=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Run GTest MacOS | ||
|
||
env: | ||
SDL_VIDEODRIVER: "dummy" | ||
SDL_AUDIODRIVER: "dummy" | ||
|
||
on: | ||
push: | ||
branches: [ "main", "**dev" ] | ||
pull_request: | ||
|
||
jobs: | ||
macos-gtest: | ||
env: | ||
MAC_ARCH: ${{ matrix.macarch }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | ||
fail-fast: false | ||
# Set up a matrix to run the following 2 configurations: | ||
# 1. <MacOS 13, x86_64, latest GCC compier toolchain on the default runner image, default generator> | ||
# 2. <MacOS 13, arm64, latest GCC compiler toolchain on the default runner image, default generator> | ||
# 3. <MacOS 13, x86_64, latest Clang compiler toolchain on the default runner image, default generator> | ||
# 4. <MacOS 13, x86_64, latest Clang compiler toolchain on the default runner image, default generator> | ||
# 5. <MacOS 14, x86_64, latest GCC compiler toolchain on the default runner image, default generator> | ||
# 6. <MacOS 14, arm64, latest GCC compiler toolchain on the default runner image, default generator> | ||
# 7. <MacOS 14, x86_64, latest Clang compiler toolchain on the default runner image, default generator> | ||
# 8. <MacOS 14, x86_64, latest Clang compiler toolchain on the default runner image, default generator> | ||
# | ||
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. | ||
matrix: | ||
os: [macos-13, macos-14] | ||
c_compiler: [gcc, clang] | ||
macarch: [x86_64, arm64] | ||
include: | ||
- os: macos-13 | ||
macarch: x86_64 | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
- os: macos-13 | ||
macarch: arm64 | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
- os: macos-13 | ||
macarch: x86_64 | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
- os: macos-13 | ||
macarch: arm64 | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
- os: macos-14 | ||
macarch: x86_64 | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
- os: macos-14 | ||
macarch: arm64 | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
- os: macos-14 | ||
macarch: x86_64 | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
- os: macos-14 | ||
macarch: arm64 | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set reusable strings | ||
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
- uses: actions/setup-python@v5 | ||
- name: Install meson | ||
run: python3 -m pip install meson ninja --break-system-packages | ||
- name: Configure meson | ||
run: meson setup build -Dbuild_tests=true | ||
- name: Build test executable | ||
run: cd build && meson compile -j$(sysctl -n hw.ncpu) | ||
- name: Run Tests | ||
run: cd build && ./krakentests --gtest_shuffle --gtest_color=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[wrap-file] | ||
directory = googletest-1.15.0 | ||
source_url = https://github.com/google/googletest/archive/refs/tags/v1.15.0.tar.gz | ||
source_filename = gtest-1.15.0.tar.gz | ||
source_hash = 7315acb6bf10e99f332c8a43f00d5fbb1ee6ca48c52f6b936991b216c586aaad | ||
patch_filename = gtest_1.15.0-1_patch.zip | ||
patch_url = https://wrapdb.mesonbuild.com/v2/gtest_1.15.0-1/get_patch | ||
patch_hash = 5f8e484c48fdc1029c7fd08807bd2615f8c9d16f90df6d81984f4f292752c925 | ||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/gtest_1.15.0-1/gtest-1.15.0.tar.gz | ||
wrapdb_version = 1.15.0-1 | ||
|
||
[provide] | ||
gtest = gtest_dep | ||
gtest_main = gtest_main_dep | ||
gmock = gmock_dep | ||
gmock_main = gmock_main_dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "gtest/gtest.h" | ||
|
||
#include "ErrorLogger.hpp" | ||
|
||
namespace | ||
{ | ||
|
||
class TestBase : public ::testing::Test | ||
{ | ||
public: | ||
TestBase() { kn::ErrorLogger::setConsoleOnly(); } | ||
virtual ~TestBase() {} | ||
|
||
protected: | ||
virtual void SetUp() {} | ||
|
||
virtual void TearDown() {} | ||
}; | ||
|
||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
test_src = [ | ||
'tests/test_Math.cpp', | ||
'tests/test_Overflow.cpp', | ||
'tests/test_Window.cpp' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters