Andre Weissflog преди 2 години
родител
ревизия
56884e76a1
променени са 4 файла, в които са добавени 105 реда и са изтрити 31 реда
  1. 12 13
      .github/workflows/main.yml
  2. 86 0
      CMakePresets.json
  3. 0 10
      tests/test_common.sh
  4. 7 8
      tests/test_linux.sh

+ 12 - 13
.github/workflows/main.yml

@@ -27,19 +27,18 @@ jobs:
         - name: test_ios
           run: |
             ./tests/test_ios.sh
-    #linux:
-    #    runs-on: ubuntu-latest
-    #    steps:
-    #    - uses: actions/checkout@v2
-    #    - uses: seanmiddleditch/gha-setup-ninja@master
-    #    - name: prepare
-    #      run: |
-    #        sudo apt-get update
-    #        sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev mesa-common-dev xorg-dev libasound-dev
-    #    - name: test_linux
-    #      run: |
-    #        cd tests
-    #        ./test_linux.sh
+    linux:
+        runs-on: ubuntu-latest
+        steps:
+        - uses: actions/checkout@v2
+        - uses: seanmiddleditch/gha-setup-ninja@master
+        - name: prepare
+          run: |
+            sudo apt-get update
+            sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev mesa-common-dev xorg-dev libasound-dev
+        - name: test_linux
+          run: |
+            ./tests/test_linux.sh
     #emscripten:
     #    runs-on: ubuntu-latest
     #    steps:

+ 86 - 0
CMakePresets.json

@@ -137,6 +137,68 @@
                 },
                 "CMAKE_SYSTEM_NAME": "iOS"
             }
+        },
+        {
+            "name": "linux_gl_debug",
+            "generator": "Ninja",
+            "binaryDir": "tests/build/linux_gl_debug",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_GLCORE33",
+                "CMAKE_BUILD_TYPE": "Debug"
+            }
+        },
+        {
+            "name": "linux_gl_release",
+            "generator": "Ninja",
+            "binaryDir": "tests/build/linux_gl_release",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_GLCORE33",
+                "CMAKE_BUILD_TYPE": "Release"
+            }
+        },
+        {
+            "name": "linux_gles3_debug",
+            "generator": "Ninja",
+            "binaryDir": "tests/build/linux_gles3_debug",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_GLES3",
+                "CMAKE_BUILD_TYPE": "Debug"
+            }
+        },
+        {
+            "name": "linux_gles3_release",
+            "generator": "Ninja",
+            "binaryDir": "tests/build/linux_gles3_release",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_GLES3",
+                "CMAKE_BUILD_TYPE": "Release"
+            }
+        },
+        {
+            "name": "linux_gl_egl_debug",
+            "generator": "Ninja",
+            "binaryDir": "tests/build/linux_gl_egl_debug",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_GLCORE33",
+                "SOKOL_FORCE_EGL": {
+                    "type": "BOOL",
+                    "value": "ON"
+                },
+                "CMAKE_BUILD_TYPE": "Debug"
+            }
+        },
+        {
+            "name": "linux_gl_egl_release",
+            "generator": "Ninja",
+            "binaryDir": "tests/build/linux_gl_egl_release",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_GLCORE33",
+                "SOKOL_FORCE_EGL": {
+                    "type": "BOOL",
+                    "value": "ON"
+                },
+                "CMAKE_BUILD_TYPE": "Release"
+            }
         }
     ],
     "buildPresets": [
@@ -219,6 +281,30 @@
             "configurePreset": "ios_arc_metal",
             "configuration": "Release",
             "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
+        },
+        {
+            "name": "linux_gl_debug",
+            "configurePreset": "linux_gl_debug"
+        },
+        {
+            "name": "linux_gl_release",
+            "configurePreset": "linux_gl_release"
+        },
+        {
+            "name": "linux_gles3_debug",
+            "configurePreset": "linux_gles3_debug"
+        },
+        {
+            "name": "linux_gles3_release",
+            "configurePreset": "linux_gles3_release"
+        },
+        {
+            "name": "linux_gl_egl_debug",
+            "configurePreset": "linux_gl_egl_debug"
+        },
+        {
+            "name": "linux_gl_egl_release",
+            "configurePreset": "linux_gl_egl_release"
         }
     ]
 }

+ 0 - 10
tests/test_common.sh

@@ -34,16 +34,6 @@ build() {
 #    cd tests
 }
 
-build_force_egl() {
-    cfg=$1
-    backend=$2
-    mode=$3
-    mkdir -p build/$cfg && cd build/$cfg
-    cmake -GNinja -DSOKOL_BACKEND=$backend -DSOKOL_FORCE_EGL=ON -DCMAKE_BUILD_TYPE=$mode ../..
-    cmake --build .
-    cd ../..
-}
-
 analyze() {
     cfg=$1
     backend=$2

+ 7 - 8
tests/test_linux.sh

@@ -1,12 +1,11 @@
 #!/usr/bin/env bash
 set -e
-source test_common.sh
+source tests/test_common.sh
 prepare
-build linux_gl_debug SOKOL_GLCORE33 Debug
-build linux_gl_release SOKOL_GLCORE33 Release
-build linux_gles3_debug SOKOL_GLES3 Debug
-build linux_gles3_release SOKOL_GLES3 Release
-build_force_egl linux_gl_egl_debug SOKOL_GLCORE33 Debug
-build_force_egl linux_gl_egl_release SOKOL_GLCORE33 Release
+build linux_gl_debug linux_gl_debug
+build linux_gl_release linux_gl_release
+build linux_gles3_debug linux_gles3_debug
+build linux_gles3_release linux_gles3_release
+build_force_egl linux_gl_egl_debug linux_gl_egl_debug
+build_force_egl linux_gl_egl_release linux_gl_egl_release
 runtest linux_gl_debug
-