1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

LibWeb: Run tests in lagom if ENABLE_LAGOM_LIBWEB is set

This commit is contained in:
Ben Wiederhake 2023-01-09 22:29:39 +01:00 committed by Andrew Kaster
parent 79b9dd6248
commit 0687a75eaa
2 changed files with 18 additions and 1 deletions

View file

@ -201,7 +201,14 @@ TEST_CASE(doctype)
// If that changes, or something is added to the test HTML, the hash needs to be adjusted.
TEST_CASE(regression)
{
auto file = MUST(Core::Stream::File::open("/usr/Tests/LibWeb/tokenizer-test.html"sv, Core::Stream::OpenMode::Read));
// This makes sure that the tests will run both on target and in Lagom.
#ifdef AK_OS_SERENITY
StringView path = "/usr/Tests/LibWeb/tokenizer-test.html"sv;
#else
StringView path = "tokenizer-test.html"sv;
#endif
auto file = MUST(Core::Stream::File::open(path, Core::Stream::OpenMode::Read));
auto file_size = MUST(file->size());
auto content = MUST(ByteBuffer::create_uninitialized(file_size));
MUST(file->read(content.bytes()));