mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:47:43 +00:00
LibWeb: Run tests in lagom if ENABLE_LAGOM_LIBWEB is set
This commit is contained in:
parent
79b9dd6248
commit
0687a75eaa
2 changed files with 18 additions and 1 deletions
|
@ -662,6 +662,16 @@ if (BUILD_LAGOM)
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibVideo)
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibVideo)
|
||||||
endforeach()
|
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
|
# JavaScriptTestRunner + LibTest tests
|
||||||
# test-js
|
# test-js
|
||||||
add_executable(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.
|
// If that changes, or something is added to the test HTML, the hash needs to be adjusted.
|
||||||
TEST_CASE(regression)
|
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 file_size = MUST(file->size());
|
||||||
auto content = MUST(ByteBuffer::create_uninitialized(file_size));
|
auto content = MUST(ByteBuffer::create_uninitialized(file_size));
|
||||||
MUST(file->read(content.bytes()));
|
MUST(file->read(content.bytes()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue