<commit_before>#Qt Creator CppUnit Helper Plugin

##Introduction

This Qt Creator plugin adds some helper functions for using CppUnit with Qt Creator.

CppUnit is a unit test framework based on the original JUnit. The original cppunit library
can be found [here](https://sourceforge.net/projects/cppunit/ "Sourceforge").
A newer freedesktop.org  fork can be found [here](https://www.freedesktop.org/wiki/Software/cppunit/ "freedesktop.org")


##Features
* Custom class wizard for creating test case class with necessary boilerplate code.
* Function to add a new test to a test class
* Shortcut to switch between testcase and main class

##Background

CppUnit requires the test to be added to a test suite so that it can be run.
Each new test needs, at minimum, the test case function itself and a separate declaration to
add it to the test suite. If the test itself is declared in a header and defined in a separate source (.cpp)
file this reuqires 3 additions (declaration, addition to test suite and definition) for each test case.

The main purpose of this plugin is to remove the tedium of adding a test case. When editing a test case class,
a new test case dialog can be opened with a shortcut (default Ctrl+Shift+T). A series of space separated test
functions can be entred and then the plugin in will
* Add a declaration to the test fixture header file
* Add the test to the test suite for the fixture
* Add an empty definition in the test source file

The original C++



##Installation

###From source
1. Set Environment variables (or modify paths.pri directly):
 - set `QTC_SOURCE` variable to path to Qt Creator source dir
 - set `QTC_BUILD` variable to  path to compiled Qt Creator dir

2. Compile plugin.


##More info
Additional information can be obtained [here](http://gres.biz/qtc-cppcheck/ "Homepage") (in russian)
<commit_msg>More description<commit_after>#Qt Creator CppUnit Helper Plugin

##Introduction

This Qt Creator plugin adds some helper functions for using CppUnit with Qt Creator.

CppUnit is a unit test framework based on the original JUnit. The original cppunit library
can be found [here](https://sourceforge.net/projects/cppunit/ "Sourceforge").
A newer freedesktop.org  fork can be found [here](https://www.freedesktop.org/wiki/Software/cppunit/ "freedesktop.org")


##Features
* Custom class wizard for creating test case class with necessary boilerplate code.
* Function to add a new test to a test class
* Shortcut to switch between testcase and main class

##Background

CppUnit requires the test case to be added to a test suite so that it can be run.
Each new test needs, at minimum, the test case function itself and a separate declaration to
add it to the test suite. If the test itself is declared in a header and defined in a separate source (.cpp)
file this reuqires 3 additions (declaration, addition to test suite and definition) for each test case.

The main purpose of this plugin is to remove the tedium of adding a test case. When editing a test case class,
a new test case dialog can be opened with a shortcut (default Ctrl+Shift+T). A series of space separated test
functions can be entred and then the plugin in will
* Add a declaration to the test fixture header file
* Add the test to the test suite for the fixture
* Add an empty definition in the test source file

The plugin also provides a shortcut to switch to the test case class. This assumes that
* tests are in a subfolder called tests
* the test case file has the same name as the current file with TestCase appeneded
So if edition a file MyClass.cpp the shortcut will look for a test file MyClassTestCase.cpp.
Although using a test-fixture-per-class rather than testing scenarios is something of a
TDD anti-pattern this can still be useful.

Using this plugin the TDD workflow is
1. Shift+F4 to switch to test case
2. Ctrl+Shift+T to add new test case
3. Code the test body
4. Build - and automatically run the tests (see tips)
5. Shift+F4 to switch back to the source
6. Implement the code.
7. Build and run tests again

##Tips

* Adding the test executable as a custom build step means the test are run automatically after each build
* Adding custom text snippets in QtCreator makes it easier to add the insert macros
  - eg ```CPPUNIT_ASSERT_EQUAL_MESSAGE("$message$", $expected$, $actual$);```
* Custom output printers for CppUnit allow MSVC/G++ style messages that can be automatially picked up by QtCreator as issues.


##Installation

###From source
1. Set Environment variables (or modify paths.pri directly):
 - set `QTC_SOURCE` variable to path to Qt Creator source dir
 - set `QTC_BUILD` variable to  path to compiled Qt Creator dir

2. Compile plugin.




{'fraction_non_alphanumeric': 0.052496798975672214, 'fraction_numerical': 0.003201024327784891, 'mean_word_length': 4.284103720405862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '586082', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1204, 'n_words': 727}