mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
headless-browser: Fix crash test globbing
Tests have the glob run against the relative path of the test file. Since this was never set for crash tests the '-f' argument to headless browser would never match the global against any crash test.
This commit is contained in:
parent
b17746eb94
commit
67f435975b
Notes:
github-actions[bot]
2025-02-10 09:26:08 +00:00
Author: https://github.com/shannonbooth
Commit: 67f435975b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3526
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 5 additions and 5 deletions
|
@ -106,7 +106,7 @@ static ErrorOr<void> collect_ref_tests(Application const& app, Vector<Test>& tes
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
static ErrorOr<void> collect_crash_tests(Vector<Test>& tests, StringView path, StringView trail)
|
static ErrorOr<void> collect_crash_tests(Application const& app, Vector<Test>& tests, StringView path, StringView trail)
|
||||||
{
|
{
|
||||||
Core::DirIterator it(ByteString::formatted("{}/{}", path, trail), Core::DirIterator::Flags::SkipDots);
|
Core::DirIterator it(ByteString::formatted("{}/{}", path, trail), Core::DirIterator::Flags::SkipDots);
|
||||||
while (it.has_next()) {
|
while (it.has_next()) {
|
||||||
|
@ -114,14 +114,14 @@ static ErrorOr<void> collect_crash_tests(Vector<Test>& tests, StringView path, S
|
||||||
auto input_path = TRY(FileSystem::real_path(ByteString::formatted("{}/{}/{}", path, trail, name)));
|
auto input_path = TRY(FileSystem::real_path(ByteString::formatted("{}/{}/{}", path, trail, name)));
|
||||||
|
|
||||||
if (FileSystem::is_directory(input_path)) {
|
if (FileSystem::is_directory(input_path)) {
|
||||||
TRY(collect_crash_tests(tests, path, ByteString::formatted("{}/{}", trail, name)));
|
TRY(collect_crash_tests(app, tests, path, ByteString::formatted("{}/{}", trail, name)));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_valid_test_name(name))
|
if (!is_valid_test_name(name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
tests.append({ TestMode::Crash, input_path, {}, {} });
|
auto relative_path = LexicalPath::relative_path(input_path, app.test_root_path).release_value();
|
||||||
|
tests.append({ TestMode::Crash, input_path, {}, move(relative_path) });
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
@ -478,7 +478,7 @@ ErrorOr<void> run_tests(Core::AnonymousBuffer const& theme, Web::DevicePixelSize
|
||||||
TRY(collect_dump_tests(app, tests, ByteString::formatted("{}/Layout", app.test_root_path), "."sv, TestMode::Layout));
|
TRY(collect_dump_tests(app, tests, ByteString::formatted("{}/Layout", app.test_root_path), "."sv, TestMode::Layout));
|
||||||
TRY(collect_dump_tests(app, tests, ByteString::formatted("{}/Text", app.test_root_path), "."sv, TestMode::Text));
|
TRY(collect_dump_tests(app, tests, ByteString::formatted("{}/Text", app.test_root_path), "."sv, TestMode::Text));
|
||||||
TRY(collect_ref_tests(app, tests, ByteString::formatted("{}/Ref", app.test_root_path), "."sv));
|
TRY(collect_ref_tests(app, tests, ByteString::formatted("{}/Ref", app.test_root_path), "."sv));
|
||||||
TRY(collect_crash_tests(tests, ByteString::formatted("{}/Crash", app.test_root_path), "."sv));
|
TRY(collect_crash_tests(app, tests, ByteString::formatted("{}/Crash", app.test_root_path), "."sv));
|
||||||
#if !defined(AK_OS_MACOS)
|
#if !defined(AK_OS_MACOS)
|
||||||
TRY(collect_ref_tests(app, tests, ByteString::formatted("{}/Screenshot", app.test_root_path), "."sv));
|
TRY(collect_ref_tests(app, tests, ByteString::formatted("{}/Screenshot", app.test_root_path), "."sv));
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue