mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 03:56:16 +00:00
Tests: Add LibWeb layout tests
This commit is contained in:
parent
c05fcd54bb
commit
78b503946c
Notes:
sideshowbarker
2024-07-17 03:14:39 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 78b503946c
Pull-request: https://github.com/SerenityOS/serenity/pull/17230
Reviewed-by: https://github.com/linusg
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