-
Notifications
You must be signed in to change notification settings - Fork 3
tests/lapi: add string tests #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ligurio
wants to merge
7
commits into
master
Choose a base branch
from
ligurio/gh-xxxx-lapi-string
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6cc9b5e
to
db026a5
Compare
3f59f73
to
13733c9
Compare
The patch add a CMake module that builds a luzer [1], a coverage-guided, native Lua fuzzing engine. Needed for the following commit. 1. https://github.com/ligurio/luzer
While extending tests it is often required to append additional path where Lua or Lua C auxiliary modules are located to LUA_PATH or LUA_CPATH environment variables. Due to insane semicolon interpolation in CMake strings (that converts such string to a list as a result), we need to escape semicolon in LUA_PATH/LUA_CPATH strings while building the resulting value. The patch introduce MakeLuaPath.cmake module to make LUA_PATH and LUA_CPATH definition convenient with <lapi_tests_make_lua_path> helper. This function takes all paths given as a variable list argument, joins them in a reverse order by a semicolon and yields the resulting string to a specified CMake variable. Needed for the following commit.
The patch adds initial infrastructure for Lua API tests and changes existed infrastructure for running these tests and adds a fuzzing tests for bitwise operations in PUC Rio (since 5.2) [1] Lua and bitwise functions in LuaJIT [2][3]. PUC Rio Lua provided auto-coercion of string arguments to numbers by default, but it has been removed from the core language in 5.4. LuaJIT provides auto-coercion of string arguments to numbers by default, but it doesn not tested by proposed tests. The patch requires commit "cmake: allow to set a Lua library outside" [4] in the `luzer` project. The proposed bitop tests are capable to reproduce a LuaJIT issue with bit op coercion for shifts in DUALNUM builds [5]. Rules from boolean algebra [6] has been used as invariants for bitwise expressions. 1. https://www.lua.org/manual/5.2/manual.html#6.7 2. https://bitop.luajit.org/semantics.html 3. https://bitop.luajit.org/api.html 4. ligurio/luzer@4ce52a6 5. LuaJIT/LuaJIT@69bbf3c1 6. https://en.wikipedia.org/wiki/Bitwise_operation#Boolean_algebra
The patch introduces an option that enables Lua API tests. The option is disabled by default because necessary dependencies are not installed in OSS Fuzz and thus workflow is failed.
The patch adds a fuzzing tests for Lua string functions and two helpers: `random_locale()`.
13733c9
to
3832770
Compare
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on
consume_integers()
andconsume_numbers()
luzer#44