Skip to content

Commit

Permalink
tests/capi: update blacklists with tests
Browse files Browse the repository at this point in the history
Enabled tests `luaL_dostring_test`, `luaL_loadbuffer_test`,
`luaL_loadstring_test` and `lua_dump_test` for PUC Rio Lua.
`lua_dump_test` was disabled in the commit 1538871
("tests: disable lua_dump_test") and tests `luaL_loadstring_test`,
`luaL_loadbuffer_test`, `luaL_dostring_test` were disabled
in the commit 81e8428 ("tests: fix test names in blacklist").

Enabled tests `lua_dump_test` and `lua_load_test` for LuaJIT.
`lua_load_test` was disabled by the commit 1ce18d5
("tests: add lua_load_test").
  • Loading branch information
ligurio committed Aug 18, 2024
1 parent 159a488 commit 3ddc43f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/capi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ function(create_test)
add_dependencies(${test_name} ${LUA_TARGET})
string(REPLACE "_test" "" test_prefix ${test_name})
set(LIBFUZZER_OPTS "${LIBFUZZER_OPTS} -artifact_prefix=${test_name}_")
if (USE_LUAJIT AND (${test_name} STREQUAL "lua_dump_test"))
set(LIBFUZZER_OPTS "${LIBFUZZER_OPTS} -only_ascii=1")
endif ()
if (USE_LUAJIT AND (${test_name} STREQUAL "lua_load_test"))
set(LIBFUZZER_OPTS "${LIBFUZZER_OPTS} -only_ascii=1")
endif ()
set(dict_path ${PROJECT_SOURCE_DIR}/corpus/${test_name}.dict)
set(corpus_path ${PROJECT_SOURCE_DIR}/corpus/${test_prefix})
if (EXISTS ${dict_path})
Expand All @@ -100,18 +106,17 @@ function(create_test)
endif (USE_LUAJIT)
endfunction()

# These Lua C functions are unsupported by LuaJIT.
list(APPEND LUAJIT_BLACKLIST_TESTS "luaL_addgsub_test")
list(APPEND LUAJIT_BLACKLIST_TESTS "luaL_bufflen_test")
list(APPEND LUAJIT_BLACKLIST_TESTS "luaL_buffsub_test")
list(APPEND LUAJIT_BLACKLIST_TESTS "luaL_buffaddr_test")
list(APPEND LUAJIT_BLACKLIST_TESTS "lua_load_test")
list(APPEND LUAJIT_BLACKLIST_TESTS "lua_stringtonumber_test")

# https://github.com/ligurio/lua-c-api-tests/issues/19
list(APPEND BLACKLIST_TESTS "luaL_dostring_test")
list(APPEND BLACKLIST_TESTS "luaL_loadbuffer_test")
list(APPEND BLACKLIST_TESTS "luaL_loadstring_test")
list(APPEND BLACKLIST_TESTS "lua_dump_test")
# Disabled because assertion is triggered
# LuaJIT ASSERT lj_bcread.c:123: bcread_byte: buffer read overflow.
list(APPEND LUAJIT_BLACKLIST_TESTS "luaL_dostring_test")
list(APPEND LUAJIT_BLACKLIST_TESTS "luaL_loadbuffer_test")
list(APPEND LUAJIT_BLACKLIST_TESTS "luaL_loadstring_test")

file(GLOB tests LIST_DIRECTORIES false ${CMAKE_CURRENT_SOURCE_DIR} *.c *.cc)
foreach(filename ${tests})
Expand Down

0 comments on commit 3ddc43f

Please sign in to comment.