2019-07-26 09:02:47 +00:00
|
|
|
cmake_minimum_required (VERSION 3.0)
|
2019-07-30 13:27:10 +00:00
|
|
|
project (Lagom)
|
2019-07-25 09:56:08 +00:00
|
|
|
|
2021-05-26 18:34:52 +00:00
|
|
|
include(../CMake/wasm_spec_tests.cmake)
|
|
|
|
|
2020-11-27 22:57:02 +00:00
|
|
|
if (NOT ENABLE_OSS_FUZZ)
|
2021-01-17 21:25:12 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -Wno-literal-suffix -O2 -Wall -Wextra -Werror -std=c++2a -fPIC -g -Wno-deprecated-copy")
|
2020-11-27 22:57:02 +00:00
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a -fPIC -g -Wno-deprecated-copy")
|
|
|
|
endif()
|
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
if (ENABLE_ADDRESS_SANITIZER)
|
|
|
|
add_definitions(-fsanitize=address -fno-omit-frame-pointer)
|
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=address")
|
|
|
|
endif()
|
2020-04-05 10:21:03 +00:00
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
if (ENABLE_MEMORY_SANITIZER)
|
|
|
|
add_definitions(-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer)
|
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins")
|
|
|
|
endif()
|
2020-04-05 10:21:03 +00:00
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
if (ENABLE_UNDEFINED_SANITIZER)
|
|
|
|
add_definitions(-fsanitize=undefined -fno-sanitize=vptr -fno-omit-frame-pointer)
|
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=undefined -fno-sanitize=vptr")
|
|
|
|
endif()
|
2020-04-05 10:21:03 +00:00
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
|
|
|
# Clang's default constexpr-steps limit is 1048576(2^20), GCC doesn't have one
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overloaded-virtual -Wno-user-defined-literals -fconstexpr-steps=16777216")
|
2020-04-05 10:21:03 +00:00
|
|
|
|
2020-04-08 08:40:02 +00:00
|
|
|
if (ENABLE_FUZZER_SANITIZER)
|
|
|
|
add_definitions(-fsanitize=fuzzer -fno-omit-frame-pointer)
|
2020-11-13 20:47:32 +00:00
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=fuzzer")
|
2020-04-08 08:40:02 +00:00
|
|
|
endif()
|
|
|
|
|
2019-07-26 09:02:47 +00:00
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
2021-02-27 11:39:55 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-expansion-to-defined -Wno-literal-suffix")
|
2019-07-26 09:02:47 +00:00
|
|
|
endif()
|
2019-07-25 09:56:08 +00:00
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
# These are here to support Fuzzili builds further down the directory stack
|
|
|
|
set(ORIGINAL_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
set(ORIGINAL_CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
set(ORIGINAL_CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|
|
|
|
2020-10-28 19:01:29 +00:00
|
|
|
file(GLOB AK_SOURCES CONFIGURE_DEPENDS "../../AK/*.cpp")
|
2021-05-07 11:02:12 +00:00
|
|
|
file(GLOB AK_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/AK/*.cpp")
|
2021-03-27 15:04:24 +00:00
|
|
|
file(GLOB LIBARCHIVE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibArchive/*.cpp")
|
2021-02-28 22:43:07 +00:00
|
|
|
file(GLOB LIBAUDIO_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibAudio/*.cpp")
|
|
|
|
list(REMOVE_ITEM LIBAUDIO_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibAudio/ClientConnection.cpp")
|
2021-01-12 11:17:30 +00:00
|
|
|
file(GLOB LIBREGEX_LIBC_SOURCES "../../Userland/Libraries/LibRegex/C/Regex.cpp")
|
|
|
|
file(GLOB LIBREGEX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibRegex/*.cpp")
|
2021-05-07 11:02:12 +00:00
|
|
|
file(GLOB LIBREGEX_TESTS CONFIGURE_DEPENDS "../../Tests/LibRegex/*.cpp")
|
2021-01-12 11:17:30 +00:00
|
|
|
file(GLOB LIBCORE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCore/*.cpp")
|
|
|
|
file(GLOB LIBELF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibELF/*.cpp")
|
2021-01-01 23:54:43 +00:00
|
|
|
# There's no way we can reliably make this cross platform
|
2021-01-12 11:17:30 +00:00
|
|
|
list(REMOVE_ITEM LIBELF_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibELF/DynamicLinker.cpp")
|
|
|
|
file(GLOB LIBGEMINI_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGemini/*.cpp")
|
|
|
|
file(GLOB LIBGFX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGfx/*.cpp")
|
|
|
|
file(GLOB LIBGUI_GML_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGUI/GML*.cpp")
|
2021-02-27 11:36:11 +00:00
|
|
|
list(REMOVE_ITEM LIBGUI_GML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibGUI/GMLSyntaxHighlighter.cpp")
|
2021-01-12 11:17:30 +00:00
|
|
|
file(GLOB LIBHTTP_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibHTTP/*.cpp")
|
|
|
|
file(GLOB LIBIPC_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibIPC/*.cpp")
|
|
|
|
file(GLOB LIBLINE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibLine/*.cpp")
|
|
|
|
file(GLOB LIBMARKDOWN_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibMarkdown/*.cpp")
|
|
|
|
file(GLOB LIBX86_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibX86/*.cpp")
|
|
|
|
file(GLOB LIBJS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibJS/*.cpp")
|
|
|
|
file(GLOB LIBJS_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibJS/*/*.cpp")
|
2021-06-13 16:10:20 +00:00
|
|
|
file(GLOB LIBJS_SUBSUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibJS/*/*/*.cpp")
|
2021-01-12 11:17:30 +00:00
|
|
|
file(GLOB LIBCOMPRESS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCompress/*.cpp")
|
2021-05-07 11:02:12 +00:00
|
|
|
file(GLOB LIBCOMPRESS_TESTS CONFIGURE_DEPENDS "../../Tests/LibCompress/*.cpp")
|
2021-01-12 11:17:30 +00:00
|
|
|
file(GLOB LIBCRYPTO_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*.cpp")
|
|
|
|
file(GLOB LIBCRYPTO_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*/*.cpp")
|
2021-05-10 18:55:25 +00:00
|
|
|
file(GLOB LIBCRYPTO_SUBSUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*/*/*.cpp")
|
2021-01-12 11:17:30 +00:00
|
|
|
file(GLOB LIBTLS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTLS/*.cpp")
|
|
|
|
file(GLOB LIBTTF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTTF/*.cpp")
|
2021-02-16 18:00:02 +00:00
|
|
|
file(GLOB LIBTEXTCODEC_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTextCodec/*.cpp")
|
2021-01-12 10:53:14 +00:00
|
|
|
file(GLOB SHELL_SOURCES CONFIGURE_DEPENDS "../../Userland/Shell/*.cpp")
|
|
|
|
file(GLOB SHELL_TESTS CONFIGURE_DEPENDS "../../Userland/Shell/Tests/*.sh")
|
2021-01-29 19:40:09 +00:00
|
|
|
list(FILTER SHELL_SOURCES EXCLUDE REGEX ".*main.cpp$")
|
2021-06-21 14:57:44 +00:00
|
|
|
file(GLOB_RECURSE LIBSQL_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibSQL/*.cpp")
|
|
|
|
list(REMOVE_ITEM LIBSQL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibSQL/AST/SyntaxHighlighter.cpp")
|
2021-05-07 11:02:12 +00:00
|
|
|
file(GLOB LIBSQL_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibSQL/*.cpp")
|
2021-05-03 18:49:35 +00:00
|
|
|
file(GLOB LIBWASM_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWasm/*/*.cpp")
|
2021-06-01 13:28:08 +00:00
|
|
|
file(GLOB LIBIMAP_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibIMAP/*.cpp")
|
2021-04-25 05:53:23 +00:00
|
|
|
file(GLOB LIBTEST_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTest/*.cpp")
|
|
|
|
list(FILTER LIBTEST_SOURCES EXCLUDE REGEX ".*Main.cpp$")
|
|
|
|
file(GLOB LIBTEST_MAIN CONFIGURE_DEPENDS "../../Userland/Libraries/LibTest/TestMain.cpp")
|
2021-06-18 21:28:49 +00:00
|
|
|
file(GLOB LIBCRYPTO_TESTS CONFIGURE_DEPENDS "../../Tests/LibCrypto/*.cpp")
|
|
|
|
file(GLOB LIBTLS_TESTS CONFIGURE_DEPENDS "../../Tests/LibTLS/*.cpp")
|
2021-04-25 05:53:23 +00:00
|
|
|
|
LibRegex: Add a regular expression library
This commit is a mix of several commits, squashed into one because the
commits before 'Move regex to own Library and fix all the broken stuff'
were not fixable in any elegant way.
The commits are listed below for "historical" purposes:
- AK: Add options/flags and Errors for regular expressions
Flags can be provided for any possible flavour by adding a new scoped enum.
Handling of flags is done by templated Options class and the overloaded
'|' and '&' operators.
- AK: Add Lexer for regular expressions
The lexer parses the input and extracts tokens needed to parse a regular
expression.
- AK: Add regex Parser and PosixExtendedParser
This patchset adds a abstract parser class that can be derived to implement
different parsers. A parser produces bytecode to be executed within the
regex matcher.
- AK: Add regex matcher
This patchset adds an regex matcher based on the principles of the T-REX VM.
The bytecode pruduced by the respective Parser is put into the matcher and
the VM will recursively execute the bytecode according to the available OpCodes.
Possible improvement: the recursion could be replaced by multi threading capabilities.
To match a Regular expression, e.g. for the Posix standard regular expression matcher
use the following API:
```
Pattern<PosixExtendedParser> pattern("^.*$");
auto result = pattern.match("Well, hello friends!\nHello World!"); // Match whole needle
EXPECT(result.count == 1);
EXPECT(result.matches.at(0).view.starts_with("Well"));
EXPECT(result.matches.at(0).view.end() == "!");
result = pattern.match("Well, hello friends!\nHello World!", PosixFlags::Multiline); // Match line by line
EXPECT(result.count == 2);
EXPECT(result.matches.at(0).view == "Well, hello friends!");
EXPECT(result.matches.at(1).view == "Hello World!");
EXPECT(pattern.has_match("Well,....")); // Just check if match without a result, which saves some resources.
```
- AK: Rework regex to work with opcodes objects
This patchsets reworks the matcher to work on a more structured base.
For that an abstract OpCode class and derived classes for the specific
OpCodes have been added. The respective opcode logic is contained in
each respective execute() method.
- AK: Add benchmark for regex
- AK: Some optimization in regex for runtime and memory
- LibRegex: Move regex to own Library and fix all the broken stuff
Now regex works again and grep utility is also in place for testing.
This commit also fixes the use of regex.h in C by making `regex_t`
an opaque (-ish) type, which makes its behaviour consistent between
C and C++ compilers.
Previously, <regex.h> would've blown C compilers up, and even if it
didn't, would've caused a leak in C code, and not in C++ code (due to
the existence of `OwnPtr` inside the struct).
To make this whole ordeal easier to deal with (for now), this pulls the
definitions of `reg*()` into LibRegex.
pros:
- The circular dependency between LibC and LibRegex is broken
- Eaiser to test (without accidentally pulling in the host's libc!)
cons:
- Using any of the regex.h functions will require the user to link -lregex
- The symbols will be missing from libc, which will be a big surprise
down the line (especially with shared libs).
Co-Authored-By: Ali Mohammad Pur <ali.mpfard@gmail.com>
2020-04-26 12:45:10 +00:00
|
|
|
set(LAGOM_REGEX_SOURCES ${LIBREGEX_LIBC_SOURCES} ${LIBREGEX_SOURCES})
|
2020-05-06 15:40:06 +00:00
|
|
|
set(LAGOM_CORE_SOURCES ${AK_SOURCES} ${LIBCORE_SOURCES})
|
2021-06-13 16:10:20 +00:00
|
|
|
set(LAGOM_MORE_SOURCES ${LIBARCHIVE_SOURCES} ${LIBAUDIO_SOURCES} ${LIBELF_SOURCES} ${LIBIPC_SOURCES} ${LIBLINE_SOURCES} ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBJS_SUBSUBDIR_SOURCES} ${LIBX86_SOURCES} ${LIBCRYPTO_SOURCES} ${LIBCOMPRESS_SOURCES} ${LIBCRYPTO_SUBDIR_SOURCES} ${LIBCRYPTO_SUBSUBDIR_SOURCES} ${LIBTLS_SOURCES} ${LIBTTF_SOURCES} ${LIBTEXTCODEC_SOURCES} ${LIBMARKDOWN_SOURCES} ${LIBGEMINI_SOURCES} ${LIBGFX_SOURCES} ${LIBGUI_GML_SOURCES} ${LIBHTTP_SOURCES} ${LAGOM_REGEX_SOURCES} ${SHELL_SOURCES} ${LIBSQL_SOURCES} ${LIBWASM_SOURCES} ${LIBIMAP_SOURCES})
|
2021-04-25 05:53:23 +00:00
|
|
|
set(LAGOM_TEST_SOURCES ${LIBTEST_SOURCES})
|
2019-07-25 09:56:08 +00:00
|
|
|
|
2021-01-23 22:29:11 +00:00
|
|
|
# FIXME: This is a hack, because the lagom stuff can be build individually or
|
|
|
|
# in combination with the system, we generate two Debug.h files. One in
|
|
|
|
# Build/AK/Debug.h and the other in Build/Meta/Lagom/AK/Debug.h.
|
|
|
|
configure_file(../../AK/Debug.h.in AK/Debug.h @ONLY)
|
2021-01-25 15:07:10 +00:00
|
|
|
configure_file(../../Kernel/Debug.h.in Kernel/Debug.h @ONLY)
|
2021-01-23 22:29:11 +00:00
|
|
|
|
|
|
|
include_directories(../../)
|
|
|
|
include_directories(../../Userland/)
|
|
|
|
include_directories(../../Userland/Libraries/)
|
|
|
|
include_directories(${CMAKE_BINARY_DIR})
|
2020-05-06 15:40:06 +00:00
|
|
|
add_library(LagomCore ${LAGOM_CORE_SOURCES})
|
2021-07-05 22:06:32 +00:00
|
|
|
find_package(Threads REQUIRED)
|
2021-07-05 22:32:07 +00:00
|
|
|
target_link_libraries(LagomCore Threads::Threads)
|
2019-07-25 09:56:08 +00:00
|
|
|
|
2020-05-06 15:40:06 +00:00
|
|
|
if (BUILD_LAGOM)
|
|
|
|
add_library(Lagom $<TARGET_OBJECTS:LagomCore> ${LAGOM_MORE_SOURCES})
|
2021-07-05 22:32:07 +00:00
|
|
|
target_link_libraries(Lagom Threads::Threads)
|
2020-11-29 12:49:13 +00:00
|
|
|
|
2020-11-29 19:01:40 +00:00
|
|
|
if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER)
|
2021-01-17 21:25:12 +00:00
|
|
|
enable_testing()
|
2021-04-25 05:53:23 +00:00
|
|
|
add_library(LagomTest $<TARGET_OBJECTS:LagomCore> ${LAGOM_TEST_SOURCES})
|
2021-07-05 22:32:07 +00:00
|
|
|
target_link_libraries(LagomTest Threads::Threads)
|
2020-11-27 22:57:02 +00:00
|
|
|
add_executable(TestApp TestApp.cpp)
|
|
|
|
target_link_libraries(TestApp Lagom)
|
|
|
|
target_link_libraries(TestApp stdc++)
|
|
|
|
|
|
|
|
add_executable(TestJson TestJson.cpp)
|
|
|
|
target_link_libraries(TestJson Lagom)
|
|
|
|
target_link_libraries(TestJson stdc++)
|
|
|
|
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(adjtime_lagom ../../Userland/Utilities/adjtime.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(adjtime_lagom PROPERTIES OUTPUT_NAME adjtime)
|
|
|
|
target_link_libraries(adjtime_lagom Lagom)
|
|
|
|
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(js_lagom ../../Userland/Utilities/js.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(js_lagom PROPERTIES OUTPUT_NAME js)
|
|
|
|
target_link_libraries(js_lagom Lagom)
|
|
|
|
target_link_libraries(js_lagom stdc++)
|
|
|
|
target_link_libraries(js_lagom pthread)
|
|
|
|
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(ntpquery_lagom ../../Userland/Utilities/ntpquery.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(ntpquery_lagom PROPERTIES OUTPUT_NAME ntpquery)
|
|
|
|
target_link_libraries(ntpquery_lagom Lagom)
|
|
|
|
|
2021-05-18 14:15:12 +00:00
|
|
|
add_executable(test-js_lagom
|
|
|
|
../../Tests/LibJS/test-js.cpp
|
|
|
|
../../Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(test-js_lagom PROPERTIES OUTPUT_NAME test-js)
|
|
|
|
target_link_libraries(test-js_lagom Lagom)
|
|
|
|
target_link_libraries(test-js_lagom stdc++)
|
|
|
|
target_link_libraries(test-js_lagom pthread)
|
2021-02-28 22:06:42 +00:00
|
|
|
add_test(
|
|
|
|
NAME JS
|
|
|
|
COMMAND test-js_lagom --show-progress=false
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
2020-11-27 22:57:02 +00:00
|
|
|
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(test-crypto_lagom ../../Userland/Utilities/test-crypto.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(test-crypto_lagom PROPERTIES OUTPUT_NAME test-crypto)
|
|
|
|
target_link_libraries(test-crypto_lagom Lagom)
|
|
|
|
target_link_libraries(test-crypto_lagom stdc++)
|
2020-06-25 12:45:23 +00:00
|
|
|
add_test(
|
2020-11-27 22:57:02 +00:00
|
|
|
NAME Crypto
|
|
|
|
COMMAND test-crypto_lagom test -t -s google.com --ca-certs-file ../../Base/etc/ca_certs.ini
|
2020-06-25 12:45:23 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
2020-11-27 22:57:02 +00:00
|
|
|
|
2021-05-04 03:06:59 +00:00
|
|
|
add_executable(test-wasm_lagom
|
|
|
|
../../Tests/LibWasm/test-wasm.cpp
|
|
|
|
../../Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp)
|
|
|
|
set_target_properties(test-wasm_lagom PROPERTIES OUTPUT_NAME test-wasm)
|
|
|
|
target_link_libraries(test-wasm_lagom Lagom)
|
|
|
|
target_link_libraries(test-wasm_lagom stdc++)
|
|
|
|
target_link_libraries(test-wasm_lagom pthread)
|
|
|
|
add_test(
|
|
|
|
NAME WasmParser
|
|
|
|
COMMAND test-wasm_lagom --show-progress=false
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
set_tests_properties(WasmParser PROPERTIES
|
2021-05-26 18:34:52 +00:00
|
|
|
ENVIRONMENT SERENITY_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../..
|
|
|
|
SKIP_RETURN_CODE 1)
|
2021-05-04 03:06:59 +00:00
|
|
|
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(disasm_lagom ../../Userland/Utilities/disasm.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(disasm_lagom PROPERTIES OUTPUT_NAME disasm)
|
|
|
|
target_link_libraries(disasm_lagom Lagom)
|
|
|
|
target_link_libraries(disasm_lagom stdc++)
|
|
|
|
|
2021-01-12 10:53:14 +00:00
|
|
|
add_executable(shell_lagom ../../Userland/Shell/main.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(shell_lagom PROPERTIES OUTPUT_NAME shell)
|
|
|
|
target_link_libraries(shell_lagom Lagom)
|
|
|
|
target_link_libraries(shell_lagom stdc++)
|
|
|
|
target_link_libraries(shell_lagom pthread)
|
2021-01-03 18:18:24 +00:00
|
|
|
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(gml-format_lagom ../../Userland/Utilities/gml-format.cpp)
|
2021-01-03 18:18:24 +00:00
|
|
|
set_target_properties(gml-format_lagom PROPERTIES OUTPUT_NAME gml-format)
|
|
|
|
target_link_libraries(gml-format_lagom Lagom)
|
|
|
|
target_link_libraries(gml-format_lagom stdc++)
|
|
|
|
|
2021-04-19 14:05:25 +00:00
|
|
|
add_executable(sql_lagom ../../Userland/Utilities/sql.cpp)
|
|
|
|
set_target_properties(sql_lagom PROPERTIES OUTPUT_NAME sql)
|
|
|
|
target_link_libraries(sql_lagom Lagom)
|
|
|
|
target_link_libraries(sql_lagom stdc++)
|
|
|
|
|
2021-05-30 15:14:16 +00:00
|
|
|
add_executable(test-iodevice ../../Tests/LibCore/TestLibCoreIODevice.cpp ${LIBTEST_MAIN})
|
|
|
|
set_target_properties(test-iodevice PROPERTIES OUTPUT_NAME test-iodevice)
|
|
|
|
target_link_libraries(test-iodevice Lagom)
|
|
|
|
target_link_libraries(test-iodevice LagomTest)
|
|
|
|
target_link_libraries(test-iodevice stdc++)
|
|
|
|
add_test(
|
|
|
|
NAME test-iodevice
|
|
|
|
COMMAND test-iodevice
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibCore
|
|
|
|
)
|
|
|
|
|
2021-05-03 18:49:35 +00:00
|
|
|
add_executable(wasm_lagom ../../Userland/Utilities/wasm.cpp)
|
|
|
|
set_target_properties(wasm_lagom PROPERTIES OUTPUT_NAME wasm)
|
|
|
|
target_link_libraries(wasm_lagom Lagom)
|
|
|
|
target_link_libraries(wasm_lagom stdc++)
|
|
|
|
|
2021-06-18 21:28:49 +00:00
|
|
|
foreach(source ${LIBCRYPTO_TESTS})
|
|
|
|
get_filename_component(name ${source} NAME_WE)
|
|
|
|
add_executable(${name}_lagom ${source} ${LIBCRYPTO_SOURCES} ${LIBTEST_MAIN})
|
|
|
|
target_link_libraries(${name}_lagom Lagom LagomTest)
|
|
|
|
add_test(
|
|
|
|
NAME ${name}_lagom
|
|
|
|
COMMAND ${name}_lagom
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(source ${LIBTLS_TESTS})
|
|
|
|
get_filename_component(name ${source} NAME_WE)
|
|
|
|
add_executable(${name}_lagom ${source} ${LIBTLS_SOURCES} ${LIBTEST_MAIN})
|
|
|
|
target_link_libraries(${name}_lagom Lagom LagomTest)
|
|
|
|
add_test(
|
|
|
|
NAME ${name}_lagom
|
|
|
|
COMMAND ${name}_lagom
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibTLS
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
2020-11-27 22:57:02 +00:00
|
|
|
foreach(TEST_PATH ${SHELL_TESTS})
|
|
|
|
get_filename_component(TEST_NAME ${TEST_PATH} NAME_WE)
|
|
|
|
add_test(
|
|
|
|
NAME "Shell-${TEST_NAME}"
|
2021-01-18 06:38:30 +00:00
|
|
|
COMMAND shell_lagom --skip-shellrc "${TEST_PATH}"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Shell/Tests
|
2020-11-27 22:57:02 +00:00
|
|
|
)
|
2021-01-18 06:38:30 +00:00
|
|
|
set_tests_properties("Shell-${TEST_NAME}" PROPERTIES
|
|
|
|
TIMEOUT 10
|
|
|
|
FAIL_REGULAR_EXPRESSION "FAIL"
|
2021-02-27 11:36:11 +00:00
|
|
|
PASS_REGULAR_EXPRESSION "PASS"
|
|
|
|
)
|
2020-11-27 22:57:02 +00:00
|
|
|
endforeach()
|
2021-01-17 21:25:12 +00:00
|
|
|
|
|
|
|
foreach(source ${AK_TEST_SOURCES})
|
|
|
|
get_filename_component(name ${source} NAME_WE)
|
2021-04-25 05:53:23 +00:00
|
|
|
add_executable(${name}_lagom ${source} ${LIBTEST_MAIN})
|
|
|
|
target_link_libraries(${name}_lagom LagomTest)
|
2021-01-17 21:25:12 +00:00
|
|
|
add_test(
|
|
|
|
NAME ${name}_lagom
|
|
|
|
COMMAND ${name}_lagom
|
|
|
|
# FIXME: Only TestJSON needs this property
|
2021-05-07 11:02:12 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/AK
|
2021-01-17 21:25:12 +00:00
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(source ${LIBREGEX_TESTS})
|
|
|
|
get_filename_component(name ${source} NAME_WE)
|
2021-04-25 05:53:23 +00:00
|
|
|
add_executable(${name}_lagom ${source} ${LAGOM_REGEX_SOURCES} ${LIBTEST_MAIN})
|
|
|
|
target_link_libraries(${name}_lagom LagomTest)
|
2021-01-17 21:25:12 +00:00
|
|
|
add_test(
|
|
|
|
NAME ${name}_lagom
|
|
|
|
COMMAND ${name}_lagom
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
endforeach()
|
2021-04-19 14:05:25 +00:00
|
|
|
|
2021-04-18 02:20:56 +00:00
|
|
|
foreach(source ${LIBCOMPRESS_TESTS})
|
|
|
|
get_filename_component(name ${source} NAME_WE)
|
2021-04-25 05:53:23 +00:00
|
|
|
add_executable(${name}_lagom ${source} ${LIBCOMPRESS_SOURCES} ${LIBTEST_MAIN})
|
|
|
|
target_link_libraries(${name}_lagom Lagom LagomTest)
|
2021-04-18 02:20:56 +00:00
|
|
|
add_test(
|
|
|
|
NAME ${name}_lagom
|
|
|
|
COMMAND ${name}_lagom
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
2021-04-19 14:05:25 +00:00
|
|
|
foreach(source ${LIBSQL_TEST_SOURCES})
|
|
|
|
get_filename_component(name ${source} NAME_WE)
|
2021-04-25 05:53:23 +00:00
|
|
|
add_executable(${name}_lagom ${source} ${LIBSQL_SOURCES} ${LIBTEST_MAIN})
|
|
|
|
target_link_libraries(${name}_lagom LagomTest)
|
2021-04-19 14:05:25 +00:00
|
|
|
add_test(
|
|
|
|
NAME ${name}_lagom
|
|
|
|
COMMAND ${name}_lagom
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
endforeach()
|
2020-11-27 22:57:02 +00:00
|
|
|
endif()
|
2021-06-17 09:49:19 +00:00
|
|
|
|
|
|
|
install(TARGETS Lagom LagomCore)
|
2020-05-06 15:40:06 +00:00
|
|
|
endif()
|
2020-04-11 11:16:17 +00:00
|
|
|
|
2020-11-27 22:57:02 +00:00
|
|
|
if (ENABLE_FUZZER_SANITIZER OR ENABLE_OSS_FUZZ)
|
2020-04-08 08:40:02 +00:00
|
|
|
add_subdirectory(Fuzzers)
|
|
|
|
endif()
|