Prerequisites - general information
-----------------------------------
Squish tests inside this folder have several prerequisites to get them running.

First - and most important - you have to own a valid Squish license. Currently it's recommended to use Squish 5.1.3.
For Squish on Mac it's necessary to change the used Python version to 2.6 inside the <SQUISHDIR>/etc/paths.ini

Second - some of the test suites/test cases expect an installed Qt 4 SDK in its default location.
On Linux/Mac this is ~/QtSDK, and on Windows this is C:\QtSDK.
After installing the QtSDK you should use the package manager of the QtSDK (SDKMaintenanceTool) to add some more packages.
You'll need at least Desktop Qt versions 4.7.4, 4.8.0, Harmattan stuff (except QEmu), Maemo Toolchain, Qt Examples, Simulator, Documentation files.

Third - some of the test suites/test cases expect Qt 5.2.1 (default toolchain), Qt 5.3.1 (default toolchain) and Qt 5.4.1 (gcc, Linux and Windows only)
installed in their default locations. On Linux/Mac this is ~/Qt5.x.1 and on Windows this is C:\Qt\Qt5.x.1. The default toolchains are gcc on Linux,
clang on Mac and MSVC2010 on Windows.

Fourth - you'll have to provide some additional repositories (and for the hooking into subprocesses even some more Squish bundles, see below).
These additional repositories are located inside ~/QtSDK/src or C:\QtSDK\src (depending on the OS you're on).
You can also just provide them inside a different folder and specify the folder with the environment variable SYSTEST_SRCPATH.
This folder must contain the following:
 * a QtCreator repository (or source copy) of tag v3.5.0 named 'creator' including the submodule src/shared/qbs
 * a subfolder called 'creator-test-data'
 * a speedcrunch 0.11 repository (or source copy) inside 'creator-test-data' named 'speedcrunch'
 * additional Squish versions for hooking into subprocesses inside different folders inside 'creator-test-data' following the information below

Fifth - you'll have to make sure that some needed tools are available (no matter on which OS you're on).
 * cmake
 * wget or curl, capable of HTTPS
Normally it should be okay to just install them as usual and add their executables' path(s) to the PATH variable.

Sixth - Qt Creator should be built with ClangCodeModel plugin. How to do so, see QTCREATOR_REPO/src/plugins/clangcodemodel/README. Without the
plugin, the tests for ClangCodeModel will be skipped but will not cause failures.

Attention! If any of these prerequisites cannot be satisfied the tests will likely fail (or not run at all).


Prerequisites - hooking into subprocesses
-----------------------------------------
The usage of the hook-into subprocess has following prerequisites:
Either:
    * have no firewall at all enabled (sure that's a bad idea)
Or:
    * have the Windows Firewall enabled (no other firewalls are handled by the scripts)
    * run the Squish tests with administrator privileges
    * additionally the UAC should be disabled, too

Otherwise you'll have some trouble with popping up dialogs from the firewall.
If you're using a different firewall - try to figure out and add a rule for this.


Using the internal test data fallback
-------------------------------------

    * inside the shared_data folder a "standard" mapping file is located (qt_squish_mapping.tsv)
    * this file defines currently some Squish versions that are available for usage
    * all of the Squish versions mentioned in there should exist inside QtSDK/src/creator-test-data (see the file for naming the Squish versions) - of course this depends on the OS you're testing on

Attention! This file will be updated with more columns (and rows) for making it possible to also test Debug builds or 64bit builds. So, even the path entries currently listed could change when this feature is implemented.


Using QT_SQUISH_MAPFILE variable
--------------------------------

    * create a simple text file (UTF-8 encoded) that follows this scheme:

     SquishVersion QtVersion mkspec Path

    * SquishVersion: only major and minor number will be used (e.g. 4.1, 4.2)
    * QtVersion: only major and minor number will be used (e.g. 4.7, 4.8, 5.0)
    * mkspec: a string holding the mkspec as it appears inside QTSDK/mkspec (or inside Qt Creator)
    * Path: the path to the Squish directory that can be used with this combination of QtVersion and mkspec
    * between QtVersion and mkspec as well as between mkspec and Path use whitespaces only
    * lines STARTING with # within the first column will be ignored
    * path can contain spaces as well as ~ (for the home directory)
    * you can put any entry of a line into quotes (no matter whether single or double quotes)
    * a line holding a mapping MUST start with a QtVersion entry in the first column

Example 1: (using single space, no quoting)

#squishversion qtversion mkspec path
4.1<SP>4.7<SP>win32-g++<SP>C:\Tools\Squish_MinGW
4.1<SP>4.7<SP>win32-msvc2008<SP>C:\Tools\Squish_MSVC9
4.1<SP>4.7<SP>win32-msvc2010<SP>C:\Tools\Squish_MSVC10
4.2<SP>4.8<SP>win32-g++<SP>C:\Tools\Squish_MinGW
4.2<SP>4.8<SP>win32-msvc2008<SP>C:\Tools\Squish_MSVC9
4.2<SP>4.8<SP>win32-msvc2010<SP>C:\Tools\Squish_MSVC10

Example 2: (using mixed whitespaces, some quoting)

#squishversion<SP>qtversion<TAB>mkspec<TAB><TAB><SP>path
4.1<SP>"4.7"<SP><TAB>win32-g++<TAB><TAB>'C:\Tools\Squish_MinGW'
4.1<SP>'4.7'<SP><TAB>'win32-msvc2008'<TAB>"C:\Tools\Squish_MSVC9"
4.1<SP>4.7<SP><SP><TAB>win32-msvc2010<TAB>C:\Tools\Squish_MSVC10
4.2<SP>"4.8"<SP><TAB>"win32-g++"<SP><SP><TAB>"C:\Tools\Squish_MinGW"
4.2<SP>'4.8'<SP><TAB>win32-msvc2008<SP><TAB>'C:\Tools\Squish_MSVC9'
4.2<SP>'4.8'<SP><TAB>win32-msvc2010<SP><TAB>C:\Tools\Squish_MSVC10

Explanation: <SP> = space, <TAB> = tabulator

    * after creating this file put it somewhere and define environment variable QT_SQUISH_MAPFILE to point directly to the file
    * definition of this variable should be done BEFORE the test is started and can be done in various ways:
        * declare this variable as a system environment variable (how to do this depends on the OS you're using) [recommended way]
        * add this variable to the envvar file inside the directory holding the Squish test suites [please don't do this when pushing envvar back to git]
        * you can also modify the os.environ dict inside the test script(s) but this has to be done, before the test tries to read the variable [best place would be right before/after the call to startApplication()]

Hint: You can also use the provided tsv file as a template. Simply remove lines you're not needing and adjust the path entries to point to the correct paths on your system and you should be fine.

Attention! The format of the file might slightly change as soon also Debug builds will be easily testable (and maybe again for 64bit builds)


Preparation of the SQUISH directories
-------------------------------------
To make the hook-into sub-process really work you have to provide a modified Squish.

Steps to set up the Squish directories on Windows:
    * get the Squish version you need from froglogic.com
    * extract the archive to place of your choice
    * go to the bin directory of Squish and remove the following dll's (Windows-only):
        * Qt3Support.dll
        * QtCore4.dll
        * QtGui4.dll
        * QtNetwork4.dll
        * QtSql4.dll
        * QtXml4.dll
    * remove all folders from the Squish root folder except bin, etc, lib and python - and on
      Windows you have to keep the VC runtime folder (Microsoft.VC??.CRT)
      (if you're using other script languages you have to keep them as well)
    * you can remove regular files from Squish root as well
      (but it's recommended to keep the buildinfo.txt for later verifications)

You can additionally remove the complete ide folder as well as squishclassicide.exe and squishide.exe (to safe disk space).
