mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
Tests: Add LibWeb layout tests
This commit is contained in:
parent
c05fcd54bb
commit
78b503946c
4 changed files with 91 additions and 0 deletions
20
Tests/LibWeb/Layout/layout_test.sh
Executable file
20
Tests/LibWeb/Layout/layout_test.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(dirname "${0}")"
|
||||
SERENITY_ROOT="$(realpath "${SCRIPT_DIR}"/../../..)"
|
||||
LADYBIRD_BUILD_DIR="${SERENITY_ROOT}/Build/ladybird"
|
||||
|
||||
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"
|
||||
else
|
||||
echo "$name FAILED"
|
||||
diff "$expected_layout_dump_path" <(echo "$output_layout_dump")
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue