mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
LibWeb: Run tests in lagom if ENABLE_LAGOM_LIBWEB is set
This commit is contained in:
parent
79b9dd6248
commit
0687a75eaa
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/0687a75eaa Pull-request: https://github.com/SerenityOS/serenity/pull/16934 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/davidot
@ -662,6 +662,16 @@ if (BUILD_LAGOM)
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibVideo)
|
||||
endforeach()
|
||||
|
||||
# Web
|
||||
if (ENABLE_LAGOM_LIBWEB)
|
||||
file(COPY "${SERENITY_PROJECT_ROOT}/Tests/LibWeb/tokenizer-test.html" DESTINATION "./")
|
||||
file(GLOB LIBWEB_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibWeb/*.cpp")
|
||||
foreach(source ${LIBWEB_TEST_SOURCES})
|
||||
lagom_test(${source} LIBS LibWeb
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibWeb)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# JavaScriptTestRunner + LibTest tests
|
||||
# test-js
|
||||
add_executable(test-js
|
||||
|
@ -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()));
|
||||
|
Loading…
Reference in New Issue
Block a user