-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Why do I write a CppUTest plugin
When you use this plugin, you can:
- Setup a TDD project for C or C++ quickly;
- Write the testing code and run it more efficiently;
- Get the Green or Red bar after testing.
TDD is a wonderful development method
It help me designing the right things.
I really appreciate Michael Feathers and other contributors make this awesome CppUTest TDD suit.
Although it provides many useful scripts to create a TDD project quickly,
I would like to write a plugin for CppUTest to make me do TDD more happy.
You should install CppUTest before using this plugin.
I also installed clang_complete plugin using clang for accurately completing C and C++ code.
I strongly recommend that you install this plugin to write C/C++ code more efficient.
If you are a new VIMer:
Copy the .vim directory and .vimrc file to your HOME and all things ready.
If you have already configured your own VIM:
- Copy .vim/plugins/CppUTest.vim and .vim/plugins/CppUTest.sh to your plugin directory.
- Copy ~/.vim/c-support/templates/c.comments.template to your template directory.
- Append following text to your .vimrc file:
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CppUTest.vim Setting
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <leader>un :call CppUTest_UnittestNew()<CR>
imap <leader>un <Esc>:call CppUTest_UnittestNew()<CR>
nmap <leader>ua :call CppUTest_UnittestAdd()<CR>
imap <leader>ua <Esc>:call CppUTest_UnittestAdd()<CR>
nmap <leader>uap :call CppUTest_UnittestAddCpp()<CR>
imap <leader>uap <Esc>:call CppUTest_UnittestAddCpp()<CR>
nmap <leader>ur :call CppUTest_UnittestRun()<CR>
imap <leader>ur <Esc>:call CppUTest_UnittestRun()<CR>
nmap <leader>up :call CppUTest_UnittestPerform()<CR>
imap <leader>up <Esc>:call CppUTest_UnittestPerform()<CR>
Setup environment
$ export TERM=xterm
$ cd ~/.vim
$ ./setupvim.sh "Your Name" [email protected] www.your-website.com "Your Company Name"
**Use shortcuts in your VIM**
Assume that your own **mapleader** for VIM is **,**.
* **,un** -- Unit testing New, create a new TDD project; * **,ua** -- Unit testing Add, add a new unit testing for C; * **,uap** -- Unit testing Add, add a new unit testing fro C++; * **,ur** -- Unit testing Run, save all files in the buffer and run the unit testing.
I appreciate authors and contributors of the following VIM plugins:
- 02tlib.vim
- DoxygenToolkit.vim
- autoclose.vim
- bufexplorer.vim
- c.vim
- clang_complete.vim
- cmdline-complete.vim
- code_complete.vim
- emmet.vim
- fuf.vim
- grep.vim
- l9.vim
- supertab.vim
- taglist.vim
- totd.vim
- molokai.vim (Color Scheme)
- ...