So far tests running within Qt Creator could be implemented with a
private slot in the plugin class starting with "test".
Binding the test functions to the plugin object/class is fine for test
functions without side effects. But as soon as side effects come into
play we need proper initialization and cleanup as it's provided by
init(), cleanup(), initTestCase() and cleanupTestCase(). However,
implementing these functions in the plugin class is not appropriate
since they would affect (potentially quite diverse) test functions.
This patch enables us to provide 'ordinary' test classes in which we can
handle initialization and clean up the usual way.
In addition to the current test invocations, e.g.:
# (1) Run all test functions of the plugin
./qtcreator -test CppTools
# (2) Run selected test functions of the plugin by stating them
./qtcreator -test CppTools,test_completion,test_builtinsymbolsearcher
# (3) Run selected test functions of the plugin by a wild card
# expression
./qtcreator -test "CppTools,*pointerdeclaration*"
# (4) Run a test function of the plugin with certain test data
./qtcreator -test CppTools,test_completion:template_1
it's now also possible to state the test class in order to execute all
test functions of that class:
# Run all test functions of a certain class:
./qtcreator -test CppTools,SomeClassWithTests
As long as the test class does not start with "test", there should not
be any problems.
Further, an invocation like (1) now additionally execute all test
functions of all test classes. For invocations of type (2), (3) and (4)
all test functions of all test classes are considered, too.
Change-Id: Ief08a6e9e451c599fd0109b8b8e57f92e3ee19f2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
De-noise loops, use QVector for items bigger than a pointer.
Change-Id: Idae68dc51a02cb6df9bdf2d920ae2de99c7bde6c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Qt 5.3 is the minimum requirement these days. Remove all fallback code
from sources and project files.
Change-Id: If6188a471197acadda4d6baee71804ba1a8026c6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Remove usage of the Q_EXPORT_PLUGIN macros, which do not exist in Qt 5.
Change-Id: I678c3cf10b9c5d5c1b9f252b0ecd1c97dc810a47
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Less typing and less cycles than join(QString) where appropriate
Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
...otherwise it might happen that no test functions will be executed,
which is highly confusing, especially since no error dialog will be
shown.
If there are errors, just print a warning and quit. If we do not quit,
the error dialog will be shown which might block build machines.
Change-Id: Ic347dfba8fefc0e0f375cf2363265008df56ee53
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
There is not even a guarantee that VERSION from os-release contains
"Linux" anywhere. Prepend "Linux" or "Unix" and add the version details
in parentheses instead.
Also remove unnecessary (and wrong) /etc/issues fallback.
Change-Id: I0457ad9e8cedeea35e0cad5ea8093652eb8428e1
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Since no one is using it and it's faster this way.
Change-Id: Ib60d3a54aed98011b2fb4bb7d159e219abebfa7e
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Only methods as programming functions are affected. Besides renaming
some actions like "Switch Between Function Declaration/Definition" this
mostly touches (api) code comments.
This is a follow-up patch to commit 872bfb7.
Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92
Reviewed-by: hjk <hjk121@nokiamail.com>
Use standard wording and fix some and style issues.
Change-Id: I6c226f8b8600833666f1da34f1f1e71cb333f30a
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
The <platform> element may contain a regular expression
matching the names of the platforms on which the plugin works.
Task-number: QTCREATORBUG-9002
Change-Id: Ic816cfed69a5dd2c4112c976843b9106ba2cbd22
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
...if no settings path is specified by the user.
The default settins path for tests will be set to the system's temporary
directory + "/qtc-${IDE_VERSION_LONG}-test-settings".
Change-Id: Ibeaf8883c80169b4d6a3a97020a16f910292d67a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Example:
./qtcreator -test CppTools,"test_cpplocatorfilters_*"
If test data is specified, it will be applied to all matching test
functions.
Change-Id: I579d9aa6ac3d3808ea7e71db3c067d468125569b
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Usually the plugin tests are executed after the session manager
evaluated the command line arguments. This is just fine for the file and
token tests of the CppEditor (fileandtokenactions_test.cpp) since these
depend on the files and projects passed in via command line.
Running qtcreator within valgrind reverses the sequence and makes it
impossible to execute the mentioned tests. Fixed by starting the tests
after the plugin initialization is done.
Change-Id: I7cc392b7da7e0d98e0ce44edba2e3abceb84fad8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
QDoc does some magic with the \class and \namespaces
and \brief commands, so the following wording must be used:
"The xxx class yyy ..."
Change-Id: Id231f30e8464898b776888d5423523de404aae34
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
QDoc cannot find functions if the signature in the \fn command
is not identical to the declaration, including 'const' qualifiers.
Removed the \fn where the documentation comes immediately before the
function, as qdoc does not need it in that case.
Change-Id: If6a2a2e2d58b394905c803787d2a93489049e4ca
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Some tests will explicitly depend on the project/session provided on the
command line.
Change-Id: I6ee9388caf54683a3e055378eda990c8f9bbcdcf
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This loads a plugin that is disabled by default.
Change-Id: Ibbc9849c417519904fe1e69a46f93a7cc1c7edc8
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>