mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:47:34 +00:00
CI: Move running LibWeb layout tests to Azure
The current config on GitHub Actions does not use ccache, so it takes quite a while to build. Instead, let's just run these tests on Azure where we already build Ladybird and have ccache enabled. This also lets us sanitize LibWeb on both Linux and macOS. The script changes here are to A) handle differences between Azure and GitHub Actions and B) to support running on macOS.
This commit is contained in:
parent
093e7e2a86
commit
9f9b8e7273
3 changed files with 33 additions and 69 deletions
|
@ -2,19 +2,30 @@
|
|||
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(dirname "${0}")"
|
||||
SERENITY_ROOT="$(realpath "${SCRIPT_DIR}"/../../..)"
|
||||
LADYBIRD_BUILD_DIR="${SERENITY_ROOT}/Build/ladybird"
|
||||
SCRIPT_DIR="$(cd -P -- "$(dirname -- "${0}")" && pwd -P)"
|
||||
LADYBIRD_BUILD_DIR="${1}"
|
||||
|
||||
for filename in "$SCRIPT_DIR"/input/*; do
|
||||
name=$(basename "$filename" .html)
|
||||
input_html_path=$(realpath "$SCRIPT_DIR")/input/"$name".html
|
||||
output_layout_dump=$(cd "$LADYBIRD_BUILD_DIR"; ./ladybird -d "$input_html_path")
|
||||
expected_layout_dump_path="$(realpath "$SCRIPT_DIR")/expected/$name.txt"
|
||||
if cmp <(echo "$output_layout_dump") "$expected_layout_dump_path"; then
|
||||
echo "$name PASSED"
|
||||
if [[ -z "${LADYBIRD_BUILD_DIR}" ]] ; then
|
||||
echo "Provide path to the Ladybird build directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(uname -s)" = "Darwin" ]] ; then
|
||||
LADYBIRD_BINARY="./ladybird.app/Contents/MacOS/ladybird"
|
||||
else
|
||||
LADYBIRD_BINARY="./ladybird"
|
||||
fi
|
||||
|
||||
for input_html_path in "${SCRIPT_DIR}"/input/*; do
|
||||
input_html_file="$(basename "${input_html_path}" .html)"
|
||||
|
||||
output_layout_dump=$(cd "${LADYBIRD_BUILD_DIR}"; "${LADYBIRD_BINARY}" -d "${input_html_path}")
|
||||
expected_layout_dump_path="${SCRIPT_DIR}/expected/${input_html_file}.txt"
|
||||
|
||||
if cmp <(echo "${output_layout_dump}") "${expected_layout_dump_path}"; then
|
||||
echo "${input_html_file} PASSED"
|
||||
else
|
||||
echo "$name FAILED"
|
||||
diff "$expected_layout_dump_path" <(echo "$output_layout_dump")
|
||||
echo "${input_html_file} FAILED"
|
||||
diff "${expected_layout_dump_path}" <(echo "${output_layout_dump}")
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue