Bug fix: Include Lua tests
authorColin Clark <colin.clark@cclark.uk>
Wed, 2 Aug 2023 15:54:36 +0000 (16:54 +0100)
committerColin Clark <colin.clark@cclark.uk>
Wed, 2 Aug 2023 15:54:36 +0000 (16:54 +0100)
When running as a GitHub action, error messages such as:

(geeqie:12363): dbind-WARNING **: 13:24:40.471: AT-SPI: Error retrieving
accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown:
The name org.a11y.Bus was not provided by any .service files

are included at the head of the run output. Work around the problem by
taking the last n lines of output.

scripts/lua-test.sh

index c50a98d..939a024 100644 (file)
@@ -65,15 +65,18 @@ base_lua=$(basename "$lua_test_file")
 result=$(xvfb-run --auto-servernum "$1" --remote --lua:"$lua_test_image","$base_lua")
 xvfb-run --auto-servernum "$1" --remote --quit
 
+## @FIXME Running on GitHub gives additional dbind-WARNINGs. The data required is the last n lines.
+result_tail=$(printf "%s" "$result" | tail --lines=7)
+
 expected=$(printf "%s\n.%s\n%s\n%s\n%s\n%s\n%s" "$(basename "$lua_test_image")" jpeg "$lua_test_image" "$(stat -c %Y "$lua_test_image")" "$(stat -c %s "$lua_test_image")" 0 200)
 
-printf "        Result               Expected\n"
-printf '%s\n' "$result" "$expected"| pr -2  --omit-header
+printf "Result                              Expected\n"
+printf '%s\n' "$result_tail" "$expected"| pr -2  --omit-header
 
 rm "$lua_test_image"
 rm "$lua_test_file"
 
-if [ "$result" = "$expected" ]
+if [ "$result_tail" = "$expected" ]
 then
        exit 0
 else