Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Qt Creator ManualTests ProjectsAndCode: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
(Update settings menu)
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=Qt Creator Manual Tests: Projects and Code=
[[Category:Tools::QtCreator::QualityAssurance]]


{| class="infotable line"
{| class="wikitable"
|- style="background: #009900"
|+ Project Management
! Project Management
! Test
! Result
! Result  
! Annotation
! Annotation
|-
|+
|
|Open a couple of Tutorials from the Welcome page and validate that they show up correctly.
Check parsing of qmake projects:
 
# Prepare sources of Qt and Qt Creator (see below)
# Select “File” -> “Open File or Project…” from Creator’s menu and open projects.pro from Qt’s sources.
# Select “File” -> “Open File or Project…” from Creator’s menu and open qtcreator.pro from Qt Creator’s sources.
# Wait until parsing finished.
# Check that the projects are completely indexed, e.g. by searching for some of [http://doc.qt.io/qt-5/classes.html Qt’s Classes] ''[qt.io]'' using the [http://doc.qt.io/qtcreator-3.2/creator-editor-locator.html Locator] ''[qt.io]''.
| automated
|
|
|-
|
|
Check parsing of qbs projects:
|+
 
|Check parsing of qbs projects:
# Prepare sources of Qt Creator (see below)
# Prepare sources of Qt Creator ([[Qt Creator ManualTests ProjectsAndCode#Preparing sources of Qt and Qt Creator|see below]])
# In “Help” -> “About Plugins…”, verify that QbsProjectManager is enabled.
# In "Help" -> "About Plugins…", verify that QbsProjectManager is enabled.
# Select “File” -> “Open File or Project…” from Creator’s menu and open qtcreator.qbs from Qt Creator’s sources.
# Select "File"-> "Open File or Project…" from Creator's menu and open qtcreator.qbs from Qt Creator's sources.
# Select a suitable kit and click "Configure Project".
# Wait until parsing finished.
# Wait until parsing finished.
# Check that the project is completely indexed, e.g. by searching for some of [http://doc.qt.io/qt-5/classes.html Qt’s Classes] ''[qt.io]'' using the [http://doc.qt.io/qtcreator-3.2/creator-editor-locator.html Locator] ''[qt.io]''.
# Check that the project is completely indexed, e.g. by searching for some of [https://doc.qt.io/qt-5/classes.html Qt's Classes] using the [https://doc.qt.io/qtcreator/creator-editor-locator.html Locator].
|
|
|
|-
|
|
Adding a build configuration:
|+
 
| Adding a build configuration:
# Open a project.
# Open a project.
# Go to “Projects” mode.
# Go to "Projects" mode.
# [http://doc.qt.io/qtcreator-3.2/creator-build-settings.html Add a new build configuration] ''[qt.io]''.
# [https://doc.qt.io/qtcreator/creator-build-settings.html Add a new build configuration].
# The project can be built successfully with this build configuration.
# The project can be built successfully with this build configuration.
|
|
|
|
|-
|+
|
| Adding a run configuration:
Adding a run configuration:
 
# Open a project.
# Open a project.
# Go to “Projects” mode.
# Go to "Projects" mode.
# [http://doc.qt.io/qtcreator-3.2/creator-run-settings.html Add a new run configuration] ''[qt.io]''.
# [https://doc.qt.io/qtcreator/creator-run-settings.html Add a new run configuration].
# The project can be run successfully with this run configuration.
# The project can be run successfully with this run configuration.
|
|
|
|
|-
|+
| Importing build of known kit:
# Build a project in Qt Creator.
# Close the project.
# Delete the file *.user from the project's directory.
# Open the project in Creator again.
# Import the build from step 1.
Validate that Creator uses the same kit as in step 1. A new kit must not be created.
|
|
Opening a project from Welcome screen:
|
 
|+
| Importing build of unknown kit:
# Build a project in Qt Creator.
# Close Creator.
# Delete the file *.user from the project's directory.
# Start Creator with empty settings, e.g. using the command line switch "-tcs". Do not have a Qt version in your PATH variable.
# Open the same project again.
# Import the build from step 1.<br/>Validate that Creator creates a new kit with the Qt version and toolchain used in step 1. It contains an appropriate debugger and can be used for building, running, debugging.
|
|
|+
| Removing kits:
# Have a couple of kits set up in Creator.
# Open a project and configure it with some kits.
# Go to "Edit" -> "Preferences..." -> "Kits" -> "Kits".
# Remove a kit.
# Click "Apply".
# Remove another kit.
# Click "OK"
Validate that the project is still usable with the remaining kits and nothing undesired happens in the process.
|
|
|+
| Opening a project from Welcome screen:
# Close all open projects.
# Close all open projects.
# Go to “Welcome” mode.
# Go to "Welcome" mode.
# Open a previously opened project by clicking its name in the Welcome screen.
# Open a previously opened project by clicking its name in the Welcome screen.
| automated
| automated
|
|
|-
|+
|
| CMake project management:
CMake project management:
# Have [http://www.cmake.org CMake] installed.
 
# Checkout SpeedCrunch's source repository from https://bitbucket.org/heldercorreia/speedcrunch.git .
# Have [http://www.cmake.org CMake] ''[cmake.org]'' installed.
# Have a Kit using Qt 5.2 or later configured in Creator.
# Windows: Add the path to the installed cmake.exe to your system’s <span class="caps">PATH</span> environment variable.
# Select "File" -> "Open File or Project…" from Creator's menu and open src/CMakeLists.txt.
# Download [http://speedcrunch.googlecode.com/files/speedcrunch-0.10.1.tar.gz SpeedCrunch’s source code package] ''[speedcrunch.googlecode.com]''.
# Select a Kit and click "Configure Project".
# Extract the package.
# Select “File” -&gt; “Open File or Project…” from Creator’s menu and open src/CMakeLists.txt.
# Follow the instructions in the wizard.
# Wait until parsing finished.
# Wait until parsing finished.
# Check that the project is completely indexed, e.g. by expanding items of the tree structure in the “Class View”.
# Check that the project is completely indexed, e.g. by expanding items of the tree structure in the "Class View".
| semi-automated
| semi-automated
|
|
|-
|+
| Creator can build and run the project from the previous test.
| Creator can build and run the project from the previous test.
| automated
| automated
|
|
|-
|+
|
| External changes:
External changes:
 
# Open a file in Creator.
# Open a file in Creator.
# Edit this file outside Creator, e.g. using some text editor.
# Edit this file outside Creator, e.g. using some text editor.
Line 84: Line 97:
| automated
| automated
|
|
|-
|+
|
| Deleted files:
Deleted files:
 
# Open a file in Creator.
# Open a file in Creator.
# Delete this file outside Creator, e.g. using some file manager.
# Delete this file outside Creator, e.g. using some file manager.
Line 93: Line 104:
| automated
| automated
|
|
|-
|+
|
| Windows: Foreign character sets:
Windows: Foreign character sets:
# Add a user whose name contains non-latin characters (Віталій , ‏ناصر , 右京) using Windows Control Panel.
 
# Add a user whose name contains non-latin characters ( Віталій , ‏ناصر , 右京 ) using Windows Control Panel.
# Login to this user account and run Creator.
# Login to this user account and run Creator.
# Create a session and activate this session. No warnings or error messages should appear.
# Create a session and activate this session. No warnings or error messages should appear.
|
|
|
|
|-
|+
| Try to make Creator crash, be evil
| Try to make Creator crash, be evil. ;-)
|
|
|
|}
|- style="background: #009900"
 
! C++ Support
{| class="wikitable"
|+  C++ Support
! Test
When running the following tests, please make sure that the ClangCodeModel plugin is enabled, which is the default.
! Result
! Result
! Annotation
! Annotation
|-
|+
| Open the project tests/manual/cplusplus-tools/cplusplus-tools.pro from Creator’s sources and perform the following tasks:
|colspan="3"| Open the project tests/manual/cplusplus-tools/cplusplus-tools.pro from Creator's sources and perform the following tasks:
|
|+
|
| Variable declarations:
|-
|
Variable declarations:
 
# Move the cursor to the usage of a variable.
# Move the cursor to the usage of a variable.
# Press F2 or select from the menu: Tools -&gt; C++ -&gt; Follow Symbol under Cursor<br /> Creator will show you the declaration of the variable.
# Press F2 or select from the menu: Tools-> C++ -> Follow Symbol under Cursor
Creator will show you the declaration of the variable.
| automated
| automated
|
|
|-
|+
|
| Function definitions:
Function definitions:
 
# Move the cursor to a function call.
# Move the cursor to a function call.
# Press F2 or select from the menu: Tools -&gt; C++ -&gt; Follow Symbol under Cursor<br /> Creator will show you the definition of the function.
# Press F2 or select from the menu: Tools-> C++ -> Follow Symbol under Cursor
Creator will show you the definition of the function.
| automated
| automated
|
|
|-
|+
|
| Definition/declaration:
Definition/declaration:
 
# Move the cursor to a function declaration
# Move the cursor to a function declaration
# Press Shift+F2 or select from menu: Tools -&gt; C++ -&gt; Switch Between Method Declaration/Definition<br /> Creator should show the definition of this function
# Press Shift+F2 or select from menu: Tools-> C++ -> Switch Between Method Declaration/Definition
# Press Shift+F2 or select from menu: Tools -&gt; C++ -&gt; Switch Between Method Declaration/Definition again<br /> Creator should show the declaration of the function again.
Creator should show the definition of this function
# Press Shift+F2 or select from menu: Tools-> C++ -> Switch Between Method Declaration/Definition again
Creator should show the declaration of the function again.
| automated
| automated
|
|
|-
|+
|
| Switching between sources and headers:
Switching between sources and headers:
 
# Open a source or header file of a source/header couple (same base name)
# Open a source or header file of a source/header couple (same base name)
# Press F4 or select from menu: Tools -&gt; C++ -&gt; Switch Header/Source<br /> Creator should show the respective other file (header/source).
# Press F4 or select from menu: Tools-> C++ -> Switch Header/Source
|
Creator should show the respective other file (header/source).
|
|-
|
|
Finding usages:
|+
 
| Finding usages:
# Open a header or source file
# Open a header or source file
# Move cursor to the usage of a variable or function call
# Move cursor to the usage of a variable or function call
# Press Ctrl+Shift+U or select from menu: Tools -&gt; C++ -&gt; Find Usages<br /> A search result view should appear at the bottom indicating files containing usages of this variable or function.<br /> When expanding the tree view-like structures, the respective lines can be seen. Double clicking on them should direct you to this file and line
# Press Ctrl+Shift+U or select from menu: Tools-> C++ -> Find References to Symbol Under Cursor
A search result view should appear at the bottom indicating files containing usages of this variable or function.
When expanding the tree view-like structures, the respective lines can be seen. Double clicking on them should direct you to this file and line
|
|
|
|
|-
|+
|
| Renaming usages:
Renaming usages:
 
# Move cursor to a variable or function call
# Move cursor to a variable or function call
# Press Ctrl+Shift+R or select from menu Tools -&gt; C++ -&gt; Rename Symbol Under Cursor<br /> You should be able to enter another name changing every occurrence of this variable or function<br /> Note: When changing variable “a” to “b”, other variables like “a1” must not be changed!
# Press Ctrl+Shift+R or select from menu Tools-> C++ -> Rename Symbol Under Cursor
You should be able to enter another name changing every occurrence of this variable or function.<br/>
'''Note''': When changing variable "a" to "b", other variables like "a1" must not be changed!
| automated
| automated
|
|
|-
|+
| When entering the first few letters of a variable or function (or: includes, keywords, function arguments, snippets, etc), Creator should automatically show possible completions. You might have to hit Ctrl+Space.
| When entering the first few letters of a variable or function (or: includes, keywords, function arguments, snippets, etc), Creator should automatically show possible completions. You might have to hit Ctrl+Space.
|
|
|
|
|-
|+
| When hovering the mouse over some variable or function call, a tooltip should appear telling you the type of this element.<br /> In case it’s a Qt object (like QString, QWidget, …), you should see a picture of the F1 button in the top right corner of the tooltip, indicating that you can easily switch to the Qt documentation of this class or method by pressing F1. Pressing F1 will open the related page.
| Configure Qt documentation in "Edit" -> "Preferences..." -> "Help" -> "Documentation".
After this, when hovering the mouse over some variable or function call, a tooltip should appear telling you the type of this element.
In case it's a Qt object (like QString, QWidget, …), you should see a picture of the F1 button in the top right corner of the tooltip, indicating that you can easily switch to the Qt documentation of this class or method by pressing F1. Pressing F1 will open the related page.
|
|
|
|
|-
|+
| Try code folding. Fold and unfold classes and functions. Does everything work as expected?
| Try code folding. Fold and unfold classes and functions. Does everything work as expected?
|
|
|+
| Try triggering Quick Fixes at different code lines by pressing Alt+Enter. Does Creator offer Quick Fixes and does it change the code correctly when you use one of them?
|
|
|
|
Line 180: Line 192:
==Preparing sources of Qt and Qt Creator==
==Preparing sources of Qt and Qt Creator==


This can be used for all following tests after it was done once.<br /> Simply download sources of Qt ([http://download.qt.io/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.tar.gz tar.gz] ''[download.qt.io]'' / [http://download.qt.io/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.zip zip] ''[download.qt.io]'') and Qt Creator ([http://download.qt.io/official_releases/qtcreator/2.8/2.8.1/qt-creator-2.8.1-src.tar.gz tar.gz] ''[download.qt.io]'' / [http://download.qt.io/official_releases/qtcreator/2.8/2.8.1/qt-creator-2.8.1-src.zip zip] ''[download.qt.io]'') and extract them. You have to build Qt outside of qtcreator. Otherwise qtcreator won’t be able to parse the Qt sources.
This can be used for all following tests after it was done once.<br />
 
Simply download sources of Qt ([https://download.qt.io/official_releases/qt/5.12/5.12.1/single/qt-everywhere-src-5.12.1.tar.xz tar.xz]/[https://download.qt.io/official_releases/qt/5.12/5.12.1/single/qt-everywhere-src-5.12.1.zip zip]) and Qt Creator ([http://download.qt.io/official_releases/qtcreator/4.9/4.9.0/qt-creator-opensource-src-4.9.0.tar.gz tar.gz]/[https://download.qt.io/official_releases/qtcreator/4.9/4.9.0/qt-creator-opensource-src-4.9.0.zip zip]) and extract them. You have to build Qt outside of qtcreator. Otherwise qtcreator won’t be able to parse the Qt sources.
===Categories:===
 
* [[:Category:Tools|Tools]]
** [[:Category:Tools::QtCreator|QtCreator]]
* [[:Category:Tools::QtCreator::QualityAssurance|QualityAssurance]]

Latest revision as of 13:45, 21 June 2022


Project Management
Test Result Annotation
Open a couple of Tutorials from the Welcome page and validate that they show up correctly.
Check parsing of qbs projects:
  1. Prepare sources of Qt Creator (see below)
  2. In "Help" -> "About Plugins…", verify that QbsProjectManager is enabled.
  3. Select "File"-> "Open File or Project…" from Creator's menu and open qtcreator.qbs from Qt Creator's sources.
  4. Select a suitable kit and click "Configure Project".
  5. Wait until parsing finished.
  6. Check that the project is completely indexed, e.g. by searching for some of Qt's Classes using the Locator.
Adding a build configuration:
  1. Open a project.
  2. Go to "Projects" mode.
  3. Add a new build configuration.
  4. The project can be built successfully with this build configuration.
Adding a run configuration:
  1. Open a project.
  2. Go to "Projects" mode.
  3. Add a new run configuration.
  4. The project can be run successfully with this run configuration.
Importing build of known kit:
  1. Build a project in Qt Creator.
  2. Close the project.
  3. Delete the file *.user from the project's directory.
  4. Open the project in Creator again.
  5. Import the build from step 1.

Validate that Creator uses the same kit as in step 1. A new kit must not be created.

Importing build of unknown kit:
  1. Build a project in Qt Creator.
  2. Close Creator.
  3. Delete the file *.user from the project's directory.
  4. Start Creator with empty settings, e.g. using the command line switch "-tcs". Do not have a Qt version in your PATH variable.
  5. Open the same project again.
  6. Import the build from step 1.
    Validate that Creator creates a new kit with the Qt version and toolchain used in step 1. It contains an appropriate debugger and can be used for building, running, debugging.
Removing kits:
  1. Have a couple of kits set up in Creator.
  2. Open a project and configure it with some kits.
  3. Go to "Edit" -> "Preferences..." -> "Kits" -> "Kits".
  4. Remove a kit.
  5. Click "Apply".
  6. Remove another kit.
  7. Click "OK"

Validate that the project is still usable with the remaining kits and nothing undesired happens in the process.

Opening a project from Welcome screen:
  1. Close all open projects.
  2. Go to "Welcome" mode.
  3. Open a previously opened project by clicking its name in the Welcome screen.
automated
CMake project management:
  1. Have CMake installed.
  2. Checkout SpeedCrunch's source repository from https://bitbucket.org/heldercorreia/speedcrunch.git .
  3. Have a Kit using Qt 5.2 or later configured in Creator.
  4. Select "File" -> "Open File or Project…" from Creator's menu and open src/CMakeLists.txt.
  5. Select a Kit and click "Configure Project".
  6. Wait until parsing finished.
  7. Check that the project is completely indexed, e.g. by expanding items of the tree structure in the "Class View".
semi-automated
Creator can build and run the project from the previous test. automated
External changes:
  1. Open a file in Creator.
  2. Edit this file outside Creator, e.g. using some text editor.
  3. Go back to the file in Creator. Creator must report that the file was changed.
automated
Deleted files:
  1. Open a file in Creator.
  2. Delete this file outside Creator, e.g. using some file manager.
  3. Go back to the file in Creator. Creator must report that the file was deleted.
automated
Windows: Foreign character sets:
  1. Add a user whose name contains non-latin characters (Віталій , ‏ناصر , 右京) using Windows Control Panel.
  2. Login to this user account and run Creator.
  3. Create a session and activate this session. No warnings or error messages should appear.
Try to make Creator crash, be evil. ;-)
C++ Support
Test

When running the following tests, please make sure that the ClangCodeModel plugin is enabled, which is the default.

Result Annotation
Open the project tests/manual/cplusplus-tools/cplusplus-tools.pro from Creator's sources and perform the following tasks:
Variable declarations:
  1. Move the cursor to the usage of a variable.
  2. Press F2 or select from the menu: Tools-> C++ -> Follow Symbol under Cursor

Creator will show you the declaration of the variable.

automated
Function definitions:
  1. Move the cursor to a function call.
  2. Press F2 or select from the menu: Tools-> C++ -> Follow Symbol under Cursor

Creator will show you the definition of the function.

automated
Definition/declaration:
  1. Move the cursor to a function declaration
  2. Press Shift+F2 or select from menu: Tools-> C++ -> Switch Between Method Declaration/Definition

Creator should show the definition of this function

  1. Press Shift+F2 or select from menu: Tools-> C++ -> Switch Between Method Declaration/Definition again

Creator should show the declaration of the function again.

automated
Switching between sources and headers:
  1. Open a source or header file of a source/header couple (same base name)
  2. Press F4 or select from menu: Tools-> C++ -> Switch Header/Source

Creator should show the respective other file (header/source).

Finding usages:
  1. Open a header or source file
  2. Move cursor to the usage of a variable or function call
  3. Press Ctrl+Shift+U or select from menu: Tools-> C++ -> Find References to Symbol Under Cursor

A search result view should appear at the bottom indicating files containing usages of this variable or function. When expanding the tree view-like structures, the respective lines can be seen. Double clicking on them should direct you to this file and line

Renaming usages:
  1. Move cursor to a variable or function call
  2. Press Ctrl+Shift+R or select from menu Tools-> C++ -> Rename Symbol Under Cursor

You should be able to enter another name changing every occurrence of this variable or function.
Note: When changing variable "a" to "b", other variables like "a1" must not be changed!

automated
When entering the first few letters of a variable or function (or: includes, keywords, function arguments, snippets, etc), Creator should automatically show possible completions. You might have to hit Ctrl+Space.
Configure Qt documentation in "Edit" -> "Preferences..." -> "Help" -> "Documentation".

After this, when hovering the mouse over some variable or function call, a tooltip should appear telling you the type of this element. In case it's a Qt object (like QString, QWidget, …), you should see a picture of the F1 button in the top right corner of the tooltip, indicating that you can easily switch to the Qt documentation of this class or method by pressing F1. Pressing F1 will open the related page.

Try code folding. Fold and unfold classes and functions. Does everything work as expected?
Try triggering Quick Fixes at different code lines by pressing Alt+Enter. Does Creator offer Quick Fixes and does it change the code correctly when you use one of them?

Preparing sources of Qt and Qt Creator

This can be used for all following tests after it was done once.
Simply download sources of Qt (tar.xz/zip) and Qt Creator (tar.gz/zip) and extract them. You have to build Qt outside of qtcreator. Otherwise qtcreator won’t be able to parse the Qt sources.