Skip to content

Support command-line arguments#21

Merged
ligurio merged 6 commits intomasterfrom
ligurio/gh-xxxx-cli-args
Mar 19, 2025
Merged

Support command-line arguments#21
ligurio merged 6 commits intomasterfrom
ligurio/gh-xxxx-cli-args

Conversation

@ligurio
Copy link
Copy Markdown
Owner

@ligurio ligurio commented Mar 18, 2025

No description provided.

ligurio and others added 6 commits February 12, 2025 20:53
The patch rename the name of a variable with module version
to `_LUZER_VERSION` for consistency with other similar variables.
Use stack allocation instead heap allocation for `so_path`,
no reason to use heap here.
The patch fixes an incorrect parsing of libFuzzer flags passed
to `luzer`.

Co-authored-by: Sergey Bronnikov <estetus@gmail.com>

Fixes #13
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 <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.
The patch introduce a Lua initialization script that loads a Lua C
luzer module.

Needed for the following commit.
The patch brings support of LibFuzzer command-line options [1].
The options passed to `Fuzz()` function will be merged with
command-line options, but command-line options have higher
priority.

```
LUA_PATH="./luzer/?.lua;;" LUA_CPATH="./build/luzer/?.so;;" \
  tarantool examples/example_basic.lua -runs=100 -max_len=1024
```

1. https://llvm.org/docs/LibFuzzer.html#options
@ligurio ligurio force-pushed the ligurio/gh-xxxx-cli-args branch from 0cb4656 to 36c801a Compare March 18, 2025 17:55
@ligurio ligurio merged commit 649289a into master Mar 19, 2025
7 checks passed
@ligurio ligurio deleted the ligurio/gh-xxxx-cli-args branch March 19, 2025 07:19
@ligurio ligurio mentioned this pull request Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants