Merge pull request #2009 from actionless/fail-on-more-errors

fix(tests: run.sh): add one more error log pattern
This commit is contained in:
Daniel Hahler 2017-08-27 12:06:37 +02:00 committed by GitHub
commit 78686166b2
4 changed files with 32 additions and 17 deletions

View File

@ -285,19 +285,23 @@ end
-- @tparam table callback.programs Paths of found .desktop files. -- @tparam table callback.programs Paths of found .desktop files.
function utils.parse_dir(dir_path, callback) function utils.parse_dir(dir_path, callback)
local function get_readable_path(file)
return file:get_path() or file:get_uri()
end
local function parser(file, programs) local function parser(file, programs)
-- Except for "NONE" there is also NOFOLLOW_SYMLINKS -- Except for "NONE" there is also NOFOLLOW_SYMLINKS
local query = gio.FILE_ATTRIBUTE_STANDARD_NAME .. "," .. gio.FILE_ATTRIBUTE_STANDARD_TYPE local query = gio.FILE_ATTRIBUTE_STANDARD_NAME .. "," .. gio.FILE_ATTRIBUTE_STANDARD_TYPE
local enum, err = file:async_enumerate_children(query, gio.FileQueryInfoFlags.NONE) local enum, err = file:async_enumerate_children(query, gio.FileQueryInfoFlags.NONE)
if not enum then if not enum then
gdebug.print_error(err) gdebug.print_warning(get_readable_path(file) .. ": " .. tostring(err))
return return
end end
local files_per_call = 100 -- Actual value is not that important local files_per_call = 100 -- Actual value is not that important
while true do while true do
local list, enum_err = enum:async_next_files(files_per_call) local list, enum_err = enum:async_next_files(files_per_call)
if enum_err then if enum_err then
gdebug.print_error(enum_err) gdebug.print_error(get_readable_path(file) .. ": " .. tostring(enum_err))
return return
end end
for _, info in ipairs(list) do for _, info in ipairs(list) do

View File

@ -261,7 +261,7 @@ for f in $tests; do
esac esac
# Parse any error from the log. # Parse any error from the log.
pattern='.*[Ee]rror.*|.*assertion failed.*|^Step .* failed:' pattern='.*[Ee]rror.*|.*assertion failed.*|^Step .* failed:|^.{19} E: awesome: .*|.*luaA_panic.*'
if [[ $fail_on_warning ]]; then if [[ $fail_on_warning ]]; then
pattern+='|^.{19} W: awesome:.*' pattern+='|^.{19} W: awesome:.*'
fi fi

View File

@ -27,12 +27,12 @@ end
-- word "error" appears in our output, the test is considered to have failed. -- word "error" appears in our output, the test is considered to have failed.
do do
local gdebug = require("gears.debug") local gdebug = require("gears.debug")
local orig_error = gdebug.print_error local orig_warning = gdebug.print_warning
function gdebug.print_error(msg) function gdebug.print_warning(msg)
msg = tostring(msg) msg = tostring(msg)
if (msg ~= "Error opening directory '/dev/null/.local/share/applications': Not a directory") and if (not msg:match("/dev/null/.local/share/applications")) and
(not msg:match("No such file or directory")) then (not msg:match("No such file or directory")) then
orig_error(msg) orig_warning(msg)
end end
end end
end end

View File

@ -12,6 +12,17 @@ if ! [ -f CMakeLists.txt ]; then
fi fi
source_dir="$PWD" source_dir="$PWD"
# Either the build dir is passed in $CMAKE_BINARY_DIR or we guess based on $PWD
# Same as in tests/run.sh.
build_dir="$CMAKE_BINARY_DIR"
if [ -z "$build_dir" ]; then
if [ -d "$source_dir/build" ]; then
build_dir="$source_dir/build"
else
build_dir="$source_dir"
fi
fi
config_file="$(mktemp)" config_file="$(mktemp)"
# Cleanup on errors / aborting. # Cleanup on errors / aborting.
@ -28,7 +39,7 @@ for theme_file in themes/*/theme.lua; do
sed "s~default/theme~$theme_name/theme~g" "awesomerc.lua" > "$config_file" sed "s~default/theme~$theme_name/theme~g" "awesomerc.lua" > "$config_file"
AWESOME_RC_FILE="$config_file" \ AWESOME_RC_FILE="$config_file" \
AWESOME_THEMES_PATH="$source_dir/themes" \ AWESOME_THEMES_PATH="$build_dir/themes" \
AWESOME_ICON_PATH="$PWD/icons" \ AWESOME_ICON_PATH="$PWD/icons" \
"$source_dir/tests/run.sh" themes/tests.lua "$source_dir/tests/run.sh" themes/tests.lua
done done