commit 01fe63bdf5f8216db271df8a43dcf3d1a96ed3e6 from: Sergey Bronnikov via: Sergey Bronnikov date: Sun Aug 18 08:49:05 2024 UTC tests/capi: enable tests The commit 15388716f29d ("tests: disable lua_dump_test"). 1. https://github.com/ligurio/lua-c-api-tests/issues/19 commit - 159a4883faa8e0c52dd2b4a13e0ddb32a2c62f6f commit + 01fe63bdf5f8216db271df8a43dcf3d1a96ed3e6 blob - d68c83b54488fd46889e3b876a11d8ba59bf156c blob + 4a3781c9f14e85febd77d7155790a23d6c9e77e2 --- tests/capi/CMakeLists.txt +++ tests/capi/CMakeLists.txt @@ -74,6 +74,18 @@ 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 "luaL_loadstring")) + # set(LIBFUZZER_OPTS "${LIBFUZZER_OPTS} -only_ascii=1") + # endif () + # if (USE_LUAJIT AND (${test_name} STREQUAL "luaL_loadbuffer_test")) + # set(LIBFUZZER_OPTS "${LIBFUZZER_OPTS} -only_ascii=1") + # endif () + # if (USE_LUAJIT AND (${test_name} STREQUAL "luaL_dostring_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 +112,18 @@ function(create_test) endif (USE_LUAJIT) endfunction() +# Lua C functions 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") +# Lua C functions unsupported by LuaJIT. +# 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)