commit 3ddc43f3df39a4ef61a4a9e916809c3a5293c184 from: Sergey Bronnikov date: Sun Aug 18 17:19:36 2024 UTC tests/capi: update blacklists with tests 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 15388716f29d ("tests: disable lua_dump_test") and tests `luaL_loadstring_test`, `luaL_loadbuffer_test`, `luaL_dostring_test` were disabled in the commit 81e842820fb3 ("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 1ce18d55c4d4 ("tests: add lua_load_test"). commit - 159a4883faa8e0c52dd2b4a13e0ddb32a2c62f6f commit + 3ddc43f3df39a4ef61a4a9e916809c3a5293c184 blob - d68c83b54488fd46889e3b876a11d8ba59bf156c blob + 0c3393ae50877fd89fab5b4fbe273d449e36fd6f --- tests/capi/CMakeLists.txt +++ tests/capi/CMakeLists.txt @@ -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}) @@ -100,19 +106,18 @@ 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") +# 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") -# 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") - file(GLOB tests LIST_DIRECTORIES false ${CMAKE_CURRENT_SOURCE_DIR} *.c *.cc) foreach(filename ${tests}) get_filename_component(test_name ${filename} NAME_WE)