浏览代码

vcmi: actually enable unit tests

Konstantin 2 年之前
父节点
当前提交
65eed5339f
共有 2 个文件被更改,包括 53 次插入4 次删除
  1. 4 4
      .github/workflows/github.yml
  2. 49 0
      CMakePresets.json

+ 4 - 4
.github/workflows/github.yml

@@ -70,12 +70,12 @@ jobs:
         include:
           - platform: linux-qt6
             os: ubuntu-22.04
-            test: 0
-            preset: linux-clang-release
+            test: 1
+            preset: linux-clang-test
           - platform: linux
             os: ubuntu-20.04
-            test: 0
-            preset: linux-gcc-release
+            test: 1
+            preset: linux-gcc-test
           - platform: mac-intel
             os: macos-12
             test: 0

+ 49 - 0
CMakePresets.json

@@ -45,6 +45,15 @@
                 "CMAKE_INSTALL_PREFIX" : "/usr/local"
             }
         },
+        {
+            "name": "linux-test",
+            "inherits": "linux-release",
+            "hidden": true,
+            "cacheVariables": {
+                "ENABLE_TEST": "ON",
+                "ENABLE_LUA": "ON"
+            }
+        },
         {
             "name": "linux-clang-release",
             "displayName": "Clang x86_64-pc-linux-gnu",
@@ -67,6 +76,26 @@
                 "CMAKE_CXX_COMPILER": "/usr/bin/g++"
             }
         },
+        {
+            "name": "linux-clang-test",
+            "displayName": "Clang x86_64-pc-linux-gnu with unit testing",
+            "description": "VCMI Linux Clang",
+            "inherits": "linux-test",
+            "cacheVariables": {
+                "CMAKE_C_COMPILER": "/usr/bin/clang",
+                "CMAKE_CXX_COMPILER": "/usr/bin/clang++"
+            }
+        },
+        {
+            "name": "linux-gcc-test",
+            "displayName": "GCC x86_64-pc-linux-gnu with unit testing",
+            "description": "VCMI Linux GCC",
+            "inherits": "linux-test",
+            "cacheVariables": {
+                "CMAKE_C_COMPILER": "/usr/bin/gcc",
+                "CMAKE_CXX_COMPILER": "/usr/bin/g++"
+            }
+        },
         {
             "name": "windows-msvc-release",
             "displayName": "Windows x64 RelWithDebInfo",
@@ -213,6 +242,16 @@
             "configurePreset": "linux-clang-release",
             "inherits": "default-release"
         },
+        {
+            "name": "linux-clang-test",
+            "configurePreset": "linux-clang-test",
+            "inherits": "default-release"
+        },
+        {
+            "name": "linux-gcc-test",
+            "configurePreset": "linux-gcc-test",
+            "inherits": "default-release"
+        },
         {
             "name": "linux-gcc-release",
             "configurePreset": "linux-gcc-release",
@@ -295,6 +334,16 @@
             "configurePreset": "linux-gcc-release",
             "inherits": "default-release"
         },
+        {
+            "name": "linux-clang-test",
+            "configurePreset": "linux-clang-test",
+            "inherits": "default-release"
+        },
+        {
+            "name": "linux-gcc-test",
+            "configurePreset": "linux-gcc-test",
+            "inherits": "default-release"
+        },
         {
             "name": "macos-xcode-release",
             "configurePreset": "macos-xcode-release",