MOCKACCINOGtest mock generators for C-files. Generates a mock header and source file with mocked functions from the original C langauge file. The header contains a C++ class that has mocked methods with the same name and signatures as the original functions. In the generated mock source file (filename_mock.cc), all the calls to the stubbed C functions functions lead to the respective mock methods inside the class. This allows easy C function mocking with gtest. InstallationDownload the extension from VS Code marketplace: https://marketplace.visualstudio.com/items?itemName=SelerLabs.mockaccino UsageTo use Mockaccino:
This way, a pair of a header and a C++ source file are generated that can be used to mock the C code using gtest. Parsing MechanismThe preprocessor directives contained in the original file as well as in the prepended preprocessor directives from the settings of this extension are processed before parsing the file. In the current version the real include files are not parsed. This is not required because this extensions is using regex to parse the files, not relying on an AST generated from a true language parser. Because of this, Mockaccino does not need to know any type identifiers before parsing the original functions. Moreover, all the unnecessary content from the input files is removed prior to regex matching. This way, Mockaccino does not even need to parse this part of input files, which is useless from the mock generation perspective. ConfigurationIn settings of this extension it is possible to configure predefined preprocessor macros that can be used with each file to help with parsing modifiers unknown to Mockaccino. Also a copyright notice for the generated files can be set. Features
VS Code marketplacehttps://marketplace.visualstudio.com/items?itemName=SelerLabs.mockaccino Githubhttps://github.com/Veenkar/mockaccino Contact e-mailveenkar@gmail.com LicenseLicensed using GNU GPL v3 |