This is a plugin that can automatically generate unit test cases for C/C++ code. It aims to simplify the process of writing test cases and improve the efficiency of developers.
Features
Automatically generate unit test cases for C/C++ code.
Support C/C++ testing framework GoogleTest.
Support generating unit test cases for function or whole file.
Support Windows, Linux, and macOS platforms.
Easy to integrate into your existing C/C++ project.
Dependencies
VSCode version >= 1.80.0
C++ TestMate (Optional, for running GoogleTest)
Installation
Search for the plugin in VSCode Extensions and click on Install.
Usage
After installing the plugin, open your C/C++ project in VSCode.
Right-click on the function or file for which you want to generate test cases.
Select 'Generate Unit Test'.
Wait for the generation to complete. A 'justest' folder will be generated in the project's root directory, containing GoogleTest unit test code.
You may need to modify the code and compile it. The generated GoogleTest executable should be inside the working directory which match the following path pattern: {build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*
Finally, you can debug and run the GoogleTest code freely.
License
This project is licensed under the MIT License.
Contact
If you have a bug to report, a feature to suggest or any questions, feel free to contact us. Email: zztao@bestsec.cn