This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/117575/

This change has been marked as submitted.


Review request for Kate, Michal Humpula and Simon St James.
By Miquel Sabaté Solà.

Updated April 16, 2014, 8:33 a.m.

Repository: ktexteditor

Description

The main.cpp file of the vimode tests is *huge* and complex. Michal started to split the tests with the review #117032 . Now it's time for the "stage 2": split the main.{h,cpp} files into separate files. My logic on splitting has been:

- modes: contains the tests for normal, insert, replace, visual and command modes.
- completion: contains the tests for code completion.
- keys: contains things like: mappings, keyparsing, macros, marks, etc.
- view: contains some random tests that affect the kate view.

I'm not the best guy at naming things, so I'm open for naming suggestions :) Moreover, I've splitted this into just 4 files because I think that it doesn't make sense to split it any further (e.g. split each mode into separate test classes). Apart from the tests, I've also added the base.{h,cpp} files, that implement the BaseTest class and other helpers. The BaseTest class contains all the code that all the test classes might want to use. Therefore, all the test classes are expected to subclass the BaseTest class.

Note also that each test class is, indeed, a QTest on its own. This means that we cannot link an executable that includes all the tests. My solution to this new problem has been to just create the all.sh script that does a simple for loop calling each test. The script starts by setting "set -e". Therefore, if it finds any error it will stop immediately, and if everything goes well it will execute all the classes properly.

Now, this is stage 2. If we agree on this and this commit finally gets pushed, I'll move to the final stage: splitting the test functions into tinier and more specific functions. In this stage I'll also try to add more test functions (e.g. in replace mode we have a TODO saying that we need more tests on this mode).

Testing

All the tests are passing.

Diffs

  • autotests/src/vimode/CMakeLists.txt (555a821)
  • autotests/src/vimode/base.h (PRE-CREATION)
  • autotests/src/vimode/base.cpp (PRE-CREATION)
  • autotests/src/vimode/completion.h (PRE-CREATION)
  • autotests/src/vimode/completion.cpp (PRE-CREATION)
  • autotests/src/vimode/fakecodecompletiontestmodel.h (PRE-CREATION)
  • autotests/src/vimode/fakecodecompletiontestmodel.cpp (PRE-CREATION)
  • autotests/src/vimode/keys.h (PRE-CREATION)
  • autotests/src/vimode/keys.cpp (PRE-CREATION)
  • autotests/src/vimode/main.h (e25ec1f)
  • autotests/src/vimode/main.cpp (ee2222f)
  • autotests/src/vimode/modes.h (PRE-CREATION)
  • autotests/src/vimode/modes.cpp (PRE-CREATION)
  • autotests/src/vimode/view.h (PRE-CREATION)
  • autotests/src/vimode/view.cpp (PRE-CREATION)

View Diff