APIFuzzing - a lua plugin for fuzzing and checking the API
#1
APIFuzzing - a lua plugin for fuzzing and checking the API

Github
https://github.com/cuberite/APIFuzzing

Commands
fuzzing
checkapi

Fuzzing
The runme file has to be copied to the root folder of Cuberite.

Running
Under windows run the file runme.bat and it will startup Cuberite.
Under linux run the file runme.sh and it will startup Cuberite.

If the server is started up run the console command fuzzing. After every restart the command has to be run again.

If an crash occurs:
  • Under linux the script will automatically restart cuberite
  • Under windows, you need to close the debugger message box that will appear and then cuberite will start again
The message Fuzzing completed! will be printed in the console, if the plugin is finished. If an crash has occurred, in the home directory of the plugin will be a file named crashed_table.txt. It contains the class name, function name and the function call of all crashes.


CheckAPI

Start the server and run the console command checkapi. The plugin will be finished if the message CheckAPI completed! appears. The results, if any, are in the console output and in cuberite log files.

Features
It can catch:
  • Syntax errors, indicates a problem in code generation of plugin
  • Runtime errors, function doesn't exists, is not exported or flag IsStatic is missing in APIDoc
It checks the return types of the function call with the APIDoc


TODOs
  • The function CreateSharedIgnoreTable in file tables.lua containg a list of classes and functions that are currently ignored
  • Find a way to run the command fuzzing on startup again, for travis use
  • The table g_FalsePositives contains functions that are false positives, the generated code needs to be improved for them
Reply
Thanks given by: NiLSPACE
#2
This a single output of the return type checker. What do you think?  Tongue

    [21:31:39] ########################## AMOUNT OF RETURN TYPES DOESN\'T MATCH ########################################
    [21:31:39] 
    [21:31:39]                                              ## Code ##
    [21:31:39] 
cRoot:Get():GetDefaultWorld():SetBlock(10, 100, 10, 144, 0) cRoot:Get():GetDefaultWorld()Big GrinoWithMobHeadAt(10, 100, 10, function(a_BlockEntity) GatherReturnValues(a_BlockEntity:SetType(SKULL_TYPE_CREEPER)) end)
    [21:31:39] 
    [21:31:39] Class = cMobHeadEntity
    [21:31:39] Function = SetType
    [21:31:39] Got = number
    [21:31:39] APIDoc = nil
    [21:31:39] #########################################################################################################
Reply
Thanks given by:
#3
You mean in the forum? Use shcode instead of code tag
Reply
Thanks given by: Seadragon91
#4
If I use shcode and then preview to see how it looks, it shows code tags, confusing  Tongue
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)