Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ligurio/lua-c-api-tests
Lua C API tests
https://github.com/ligurio/lua-c-api-tests
fuzzing libfuzzer lua luajit oss-fuzz
Last synced: 3 months ago
JSON representation
Lua C API tests
- Host: GitHub
- URL: https://github.com/ligurio/lua-c-api-tests
- Owner: ligurio
- License: other
- Created: 2023-02-27T18:07:56.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-17T08:53:56.000Z (4 months ago)
- Last Synced: 2024-09-17T11:22:42.645Z (4 months ago)
- Topics: fuzzing, libfuzzer, lua, luajit, oss-fuzz
- Language: C++
- Homepage:
- Size: 154 KB
- Stars: 11
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# Lua C API tests
is a set of fuzzing tests for C implementations of Lua runtime (PUC Rio Lua and
LuaJIT).### Building
```sh
git clone --jobs $(nproc) --recursive https://github.com/ligurio/lua-c-api-tests
CC=clang CXX=clang++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DUSE_LUA=ON [-DUSE_LUAJIT=ON]
cmake --build build --parallel
```CMake options:
- `USE_LUA` enables building PUC Rio Lua.
- `USE_LUAJIT` enables building LuaJIT.
- `LUA_VERSION` could be a Git branch, tag or commit. By default `LUA_VERSION` is
`master` for PUC Rio Lua and `v2.1` for LuaJIT.
- `ENABLE_LUAJIT_RANDOM_RA` enables randomness in a register allocation. Option
is LuaJIT-specific.
- `ENABLE_ASAN` enables AddressSanitizer.
- `ENABLE_UBSAN` enables UndefinedBehaviorSanitizer.
- `ENABLE_COV` enables coverage instrumentation.
- `ENABLE_LUA_ASSERT` enables all assertions inside Lua source code.
- `ENABLE_LUA_APICHECK` enables consistency checks on the C API.
- `OSS_FUZZ` enables support of OSS Fuzz.
- `ENABLE_BUILD_PROTOBUF` enables building Protobuf library, otherwise system
library is used.
- `ENABLE_INTERNAL_TESTS` enables internal tests.### Running
```sh
cmake --build build --target test
cd build && RUNS=100000 ctest -R luaL_gsub_test --verbose1: Done 100000 runs in 5 second(s)
```### References
- [Lua 5.4 Reference Manual: 4 – The Application Program Interface](https://www.lua.org/manual/5.4/manual.html#4)
- [Lua 5.3 Reference Manual: 4 – The Application Program Interface](https://www.lua.org/manual/5.3/manual.html#4)
- [Lua 5.2 Reference Manual: 4 – The Application Program Interface](https://www.lua.org/manual/5.2/manual.html#4)
- [Lua 5.1 Reference Manual: 3 – The Application Program Interface](https://www.lua.org/manual/5.1/manual.html#3)### License
Copyright (C) 2022-2024 [Sergey Bronnikov](https://bronevichok.ru/),
released under the ISC license. See a full Copyright Notice in the LICENSE file.