summaryrefslogtreecommitdiff
path: root/Meta/Lagom/CMakeLists.txt
AgeCommit message (Collapse)Author
2021-05-27Meta: Run the Wasm spec tests in CIAli Mohammad Pur
Since LibWasm is still not capable of passing all of the spec tests, ignore failing tests, only fail the build if some segfault/abort/etc occurs.
2021-05-21LibWasm+Meta: Add test-wasm and optionally test the conformance testsAli Mohammad Pur
This only tests "can it be parsed", but the goal of this commit is to provide a test framework that can be built upon :) The conformance tests are downloaded, compiled* and installed only if the INCLUDE_WASM_SPEC_TESTS cmake option is enabled. (*) Since we do not yet have a wast parser, the compilation is delegated to an external tool from binaryen, `wasm-as`, which is required for the test suite download/install to succeed. This *does* run the tests in CI, but it currently does not include the spec conformance tests.
2021-05-18LibJS+LibTest: Move out the test-js test runner into LibTestAli Mohammad Pur
2021-05-17Meta: Build LibWasm and the wasm utility as part of LagomAli Mohammad Pur
2021-05-14Lagom: Enable sanitizer builds with gccAndrew Kaster
Previously the CMake options for -fsanitize=address, thread and undefined were gated behind clang, which was unecessary. Only -fsanitize=fuzzer is clang-only.
2021-05-13LibCrypto: Split BigInteger operations into an Algorithms classDexesTTP
Since the operations are already complicated and will become even more so soon, let's split them into their own files. We can also integrate the NumberTheory operations that would better fit there into this class as well. This commit doesn't change behaviors, but moves the allocation of some variables into caller classes.
2021-05-09LibSQL: Add a syntax highlighterDylan Katz
2021-05-08Meta + Lagom: Fix paths after movement of tests to Tests/Brian Gianforcaro
Not sure how this didn't cause a build break when I originally moved them in #6891. Better fix them now.
2021-05-08Tests: Move Userland/Utilities/test-js to Tests/LibJSBrian Gianforcaro
2021-05-01Lagom/CMake: Add -fconstexpr-steps for AppleClangCarlos César Neves Enumo
2021-04-29Meta: Increase fconstexpr-steps for Clang Lagom buildsIdan Horowitz
Clang's default constexpr-steps limit is 1048576, which is not enough for LibGfx's generation of the unicode bidirectional class lookup table while GCC doesn't have any limit at all, so this patch increases the limit to an arbitrarily larger value.
2021-04-25AK+Userland: Move AK/TestSuite.h into LibTest and rework Tests' CMakeAndrew Kaster
As many macros as possible are moved to Macros.h, while the macros to create a test case are moved to TestCase.h. TestCase is now the only user-facing header for creating a test case. TestSuite and its helpers have moved into a .cpp file. Instead of requiring a TEST_MAIN macro to be instantiated into the test file, a TestMain.cpp file is provided instead that will be linked against each test. This has the side effect that, if we wanted to have test cases split across multiple files, it's as simple as adding them all to the same executable. The test main should be portable to kernel mode as well, so if there's a set of tests that should be run in self-test mode in kernel space, we can accomodate that. A new serenity_test CMake function streamlines adding a new test with arguments for the test source file, subdirectory under /usr/Tests to install the test application and an optional list of libraries to link against the test application. To accomodate future test where the provided TestMain.cpp is not suitable (e.g. test-js), a CUSTOM_MAIN parameter can be passed to the function to not link against the boilerplate main function.
2021-04-21Tests: Reorganize LibCompress unit testsMarco Biscaro
Move LibCompress unit tests to LibCompress/Tests directory and register them with CMake's add_test. This allows us to run these tests with ninja test instead of running a separate executable. Also split the existing tests in 3 test files that better follow the source code structure (inspired by AK tests).
2021-04-20Lagom: Add sql utility and LibSQL unit testsTimothy Flynn
2021-03-27Lagom/Fuzzers: Add fuzzer for zip file parserLuke
2021-03-02Meta: Run test-js and test-compress as CTest executablesAndrew Kaster
Reduces the number of steps in the Actions workflow this way :^)
2021-03-01AK/Lagom: Modify TestSuite to return how many tests failed from mainAndrew Kaster
This allows us to remove the FAIL_REGEX logic from the CTest invocation of AK and LibRegex tests, as they will return a non-zero exit code on failure :^). Also means that running a failing TestSuite-enabled test with the run-test-and-shutdown script will actually print that the test failed.
2021-03-01Lagom/Fuzzers: Add WAV fuzzerLuke
2021-02-28Meta: Build AK and LibRegex tests in Lagom and for SerenityAndrew Kaster
These tests were never built for the serenity target. Move their Lagom build steps to the Lagom CMakeLists.txt, and add serenity build steps for them. Also, fix the build errors when building them with the serenity cross-compiler :^)
2021-02-27Lagom: Build with -Wno-literal-suffix when using GCCLinus Groh
This is already set in the root CMakeLists.txt as well as here for Clang (-Wno-user-defined-literals), but was forgotten for GCC which made an Lagom-only build (cmake ../Meta/Lagom [...]) fail.
2021-02-27Lagom: CMakeLists.txt housekeepingLinus Groh
- Remove unused LIBM_SOURCES - Some cosmetic and whitespace changes
2021-02-24AK: Add support for AK::StringView literals with operator""svBrian Gianforcaro
A new operator, operator""sv was added as of C++17 to support string_view literals. This allows string_views to be constructed from string literals and with no runtime cost to find the string length. See: https://en.cppreference.com/w/cpp/string/basic_string_view/operator%22%22sv This change implements that functionality in AK::StringView. We do have to suppress some warnings about implementing reserved operators as we are essentially implementing STL functions in AK as we have no STL :).
2021-02-16Lagom: Build LibTextCodec into LagomAndreas Kling
2021-01-30Lagom: Don't include Shell/main.cppBen Wiederhake
This caused some confusion: Apparently, clang has no trouble overriding Shell's main, and this issue only surfaced when I tried to build the fuzzers with wrong configuration (i.e., without the clang-injected 'main'). The diff is suggested by, and work of, @alimpfard.
2021-01-28Lagom+AK: Remove remains of clang -Wconsumed usageAndreas Kling
We stopped using that warning ages ago since it confused the compiler.
2021-01-26Meta: Split debug defines into multiple headers.asynts
The following script was used to make these changes: #!/bin/bash set -e tmp=$(mktemp -d) echo "tmp=$tmp" find Kernel \( -name '*.cpp' -o -name '*.h' \) | sort > $tmp/Kernel.files find . \( -path ./Toolchain -prune -o -path ./Build -prune -o -path ./Kernel -prune \) -o \( -name '*.cpp' -o -name '*.h' \) -print | sort > $tmp/EverythingExceptKernel.files cat $tmp/Kernel.files | xargs grep -Eho '[A-Z0-9_]+_DEBUG' | sort | uniq > $tmp/Kernel.macros cat $tmp/EverythingExceptKernel.files | xargs grep -Eho '[A-Z0-9_]+_DEBUG' | sort | uniq > $tmp/EverythingExceptKernel.macros comm -23 $tmp/Kernel.macros $tmp/EverythingExceptKernel.macros > $tmp/Kernel.unique comm -1 $tmp/Kernel.macros $tmp/EverythingExceptKernel.macros > $tmp/EverythingExceptKernel.unique cat $tmp/Kernel.unique | awk '{ print "#cmakedefine01 "$1 }' > $tmp/Kernel.header cat $tmp/EverythingExceptKernel.unique | awk '{ print "#cmakedefine01 "$1 }' > $tmp/EverythingExceptKernel.header for macro in $(cat $tmp/Kernel.unique) do cat $tmp/Kernel.files | xargs grep -l $macro >> $tmp/Kernel.new-includes ||: done cat $tmp/Kernel.new-includes | sort > $tmp/Kernel.new-includes.sorted for macro in $(cat $tmp/EverythingExceptKernel.unique) do cat $tmp/Kernel.files | xargs grep -l $macro >> $tmp/Kernel.old-includes ||: done cat $tmp/Kernel.old-includes | sort > $tmp/Kernel.old-includes.sorted comm -23 $tmp/Kernel.new-includes.sorted $tmp/Kernel.old-includes.sorted > $tmp/Kernel.includes.new comm -13 $tmp/Kernel.new-includes.sorted $tmp/Kernel.old-includes.sorted > $tmp/Kernel.includes.old comm -12 $tmp/Kernel.new-includes.sorted $tmp/Kernel.old-includes.sorted > $tmp/Kernel.includes.mixed for file in $(cat $tmp/Kernel.includes.new) do sed -i -E 's/#include <AK\/Debug\.h>/#include <Kernel\/Debug\.h>/' $file done for file in $(cat $tmp/Kernel.includes.mixed) do echo "mixed include in $file, requires manual editing." done
2021-01-25Everywhere: Use CMake to generate AK/Debug.h.asynts
This was done with the help of several scripts, I dump them here to easily find them later: awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in) do find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \; done # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list. awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
2021-01-24Lagom/Fuzzers: Fix FuzzilliJs build and update patch for new Fuzzilli versionLuke
-fsanitize=fuzzer was being added to LINKER_FLAGS from Lagom/CMakeLists, which we don't want with FuzzilliJs as we want to define the functions it provides ourselves.
2021-01-19Shell: Make tests use PASS/FAIL instead of exit codesAnotherTest
There's no guarantee that the last executed command will have a zero exit code, and so the shell exit code may or may not be zero, even if all the tests pass. Also changes the `test || echo fail && exit` to `if not test { echo fail && exit }`, since that's nicer-looking.
2021-01-12Lagom: Add Userland/ to include pathsAndreas Kling
This should make FuzzShell build.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling
2021-01-12Userland: Move command-line utilities to Userland/Utilities/Andreas Kling
2021-01-12Shell: Move to Userland/Shell/Andreas Kling
2021-01-03Lagom: Build gml-formatLinus Groh
2021-01-03Loader.so+LibELF: Move most of Loader.so's logic into ELF::DynamicLinkerWilliam Marlow
Loader.so now just performs the initial self relocations and static LibC initialisation before handing over to ELF::DynamicLinker::linker_main to handle the rest of the process. As a trade-off, ELF::DynamicLinker needs to be explicitly excluded from Lagom unless we really want to try writing a cross platform dynamic loader
2021-01-02Lagom/Fuzzers: Add TTF fuzzerLuke
2021-01-01Lagom: Build test-compressAndreas Kling
2021-01-01CMake: Consolidate all options to the root of the projectBrian Gianforcaro
2020-12-15Meta: Set a 10 second timeout on Shell testsAnotherTest
Shell-backgrounding seems to be deadlocking at times, until that's fixed, let's not take 5 hours to fail the build.
2020-11-29Meta: Add GitHub Actions workflow for Lagom with FuzzersLuke
There are cases where Lagom will build with GCC but not Clang. This often goes unnoticed for a while as we don't often build with Clang. However, this is now important to test in CI because of the OSS-Fuzz integration. Note that this only tests the build, it does not run any tests. Note that it also only builds LagomCore, Lagom and the fuzzers. It does not build the other programs that use Lagom.
2020-11-29Lagom: Add a Shell parser fuzzerAnotherTest
2020-11-27Lagom: Various fixes to make Lagom run on OSS-Fuzz (#4176)DavidKorczynski
2020-11-27LibRegex: Add a regular expression libraryEmanuel Sprung
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-11-14Lagom: Use -fsanitize=fuzzer, not -fsanitize=fuzzer-no-linkNico Weber
Fuzzers don't link for me without this change.
2020-11-12Lagom: Add ntpquery to lagom buildNico Weber
2020-11-10Userland: Add an "adjtime" utilityNico Weber
It's a thin userland wrapper around adjtime(2). It can be used to view current pending time adjustments, and root can use it to smoothly adjust the system time. As far as I can tell, other systems don't have a userland utility for this, but it seems useful. Useful enough that I'm adding it to the lagom build so I can use it on my linux box too :)
2020-10-30LibTLS: (Almost) verify certificate chain against root CA certificatesAnotherTest
Also adds a very primitive systemwide ca_certs.ini file.
2020-10-29CMake: Use CONFIGURE_DEPENDS in existing globs.asynts
2020-09-01Build: Add some -Wno-unknown-warning-option flags to CXXFLAGSAndreas Kling
Patch from Anonymous.
2020-08-24Meta+Userland: Run the TLS test tooAnotherTest
While this _does_ add a point of failure, it'll be a pretty bad day when google goes down. And this is unlikely to put a (positive) dent in their incoming requests, so let's just roll with it until we have our own TLS server.