]> git.mdlowis.com Git - proto/labwc.git/commitdiff
CI: verify early exit on missing fonts
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 9 May 2025 13:51:31 +0000 (15:51 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 9 May 2025 19:20:54 +0000 (20:20 +0100)
.github/workflows/build.yml
scripts/ci/smoke-test.sh

index 7c673b823ecd570b67f42a456c1edf0dac9e64e2..a44b8a7abab3fc12efbb4bea34f2fabcfb79f3a1 100644 (file)
@@ -262,3 +262,15 @@ jobs:
             meson compile -C build-gcc-gdb
             LABWC_RUNS=2 scripts/ci/smoke-test.sh build-gcc-gdb
           ' | $TARGET
+
+      - name: Build with gcc - catch no font installed case
+        if: matrix.name == 'Void-musl'
+        run: |
+          echo '
+            cd "$GITHUB_WORKSPACE"
+            xbps-remove -y dejavu-fonts-ttf
+            export CC=gcc
+            meson setup build-gcc-nofont -Dxwayland=enabled --werror
+            meson compile -C build-gcc-nofont
+            LABWC_EXPECT_RETURNCODE=1 scripts/ci/smoke-test.sh build-gcc-nofont
+          ' | $TARGET
index d32ad4843586b82a4946b06bbdb8e621891e731f..7ec7cd59a82268cb3036bbf11d2c8c76292cdc63 100755 (executable)
@@ -2,6 +2,8 @@
 
 : ${LABWC_RUNS:=1}
 : ${LABWC_LEAK_TEST:=0}
+: ${LABWC_EXPECT_RETURNCODE:=0}
+: ${LABWC_VERBOSE:=0}
 
 if ! test -x "$1/labwc"; then
        echo "$1/labwc not found"
@@ -55,13 +57,20 @@ for((i=1; i<=LABWC_RUNS; i++)); do
        printf "Starting run %2s\n" $i
        output=$(gdb_run 2>&1)
        ret=$?
-       if test $ret -ne 0; then
+       if test $ret -ne $LABWC_EXPECT_RETURNCODE; then
                echo "Crash encountered:"
                echo "------------------"
                echo "$output"
                break
+       elif test $LABWC_VERBOSE -eq 1; then
+               echo "------------------"
+               echo "$output"
        fi
 done
 
 echo "labwc terminated with return code $ret"
-exit $ret
+if test $ret -eq $LABWC_EXPECT_RETURNCODE; then
+       exit 0;
+else
+       exit 1;
+fi