|
Squirt 3.21
|
HspScript is a class for the CTRL script actions. More...
Public Member Functions | |
| public | HspScript () |
| A default constructor. | |
| public void | setScript (const string &script) |
| The Function sets the content of a CTRL script. More... | |
| public string | getScript () |
| The function returns the content of a CTRL script. More... | |
| public bool | isEmpty () |
| The function checks if a CTRL script is empty. More... | |
| public string | getFileName () |
| The function returns the file name of a CTRL script. More... | |
| public string | getFilePath () |
| The function returns the relative path to a CTRL script. More... | |
| public string | getFileRelPath () |
| The function returns the relative path to a CTRL script in a native format. More... | |
| public int | setFilePath (const string &path) |
| The function sets a path to this CTRL script. More... | |
| public int | makeScriptFromTemlate (const string &templateRelPath) |
| The function creates a new CTRL script from the given template. More... | |
| public void | makeFileHeader () |
| The function creates a mini header for a CTRL script. More... | |
| public int | replaceKey (const string &key, const string &value) |
| The function replaces given keys by value in a CTRL script. More... | |
| public bool | isPartOf (const string &scriptType) |
| The function checks the CTRL script part of the given relative path. More... | |
| public int | trimTrailingSpace () |
| The function removes all trailing spaces from the lines in a CTRL script. More... | |
| public int | trimLeadingSpace () |
| The function removes all leading spaces from the lines in a CTRL script. More... | |
| public string | getExampleRelPath () |
| The function returns the relative path to the example of the specified CTRL script. More... | |
| public string | getExampleFullPath () |
| The function returns the full path to the example of the specified CTRL script. More... | |
| public bool | exampleExist () |
| The function checks if an example for a CTRL script exists. More... | |
| public int | createExample () |
| The function creates an example for a library. More... | |
| public string | getUnitTestRelPath () |
| The function returns the relative path to the unit test of the specified CTRL script. More... | |
| public string | getUnitTestFullPath () |
| The function returns the full path to the example of the specified script. More... | |
| public bool | unitTestExist () |
| The function checks if a uni test exists. More... | |
| public int | createUnitTest () |
| The function creates a unit test for the library. More... | |
| public string | getGuiTestRelPath () |
| Returns the default GUI test directory for the current panel file. More... | |
| public dyn_string | getGuiTestFullPaths () |
| Returns all GUI test script paths for the current panel. More... | |
| public bool | guiTestExist () |
| Checks whether at least one GUI test exists for the current panel. More... | |
| public int | startExample (string relPath="", string addOptions="") |
| The function starts an example for the library. More... | |
| public int | startUnitTest (string relPath="", string addOptions="") |
| The function starts a unit test for the library. More... | |
| public int | startGuiTests (string relPath="", string addOptions="") |
| Starts one or all GUI tests for the current panel. More... | |
| private int | startGuiTest (string relPath, string addOptions) |
| Starts a single GUI test script. More... | |
| public string | getCoverageReportPath () |
| The function returns the relative path to the coverage report. More... | |
| public void | showErrMsg (const anytype &msg) |
| The function shows a message in the CTRL script editor. More... | |
| public bool | isNewFile () |
| The function checks if a CTRL script file is empty (0 byte). More... | |
| public bool | isRunning (const string path) |
| The function checks if the given script is running. More... | |
| public int | stopRunningScript (const string path) |
| The function stops the given script. More... | |
Static Public Member Functions | |
| static public string | getDelim (int spaces=0) |
| The function returns a line delimiter with a fixed length. More... | |
Public Attributes | |
| public bool | guiTest |
| TRUE when script execution should use GUI test mode (UI manager). | |
Protected Member Functions | |
| protected string | stripFromProjPath (string fullPath, const string &relPath) |
| The function returns a relative path. More... | |
| protected string | fileNameToClassName () |
| The function returns the CTRL class name by the file name. More... | |
| protected int | start (const string &relPath, const string addOptions="", bool doCoverage=FALSE) |
| The function starts the system call with the given script path and options. More... | |
| protected void | addScriptToRunning (const string &path) synchronized(mutex) |
| The function adds a CTRL script and its PID to a list of running scripts. More... | |
| protected void | removeScriptFromRunning (const string &path) synchronized(mutex) |
| The function removes a CTRL script from the list of running scripts. More... | |
| protected void | updateScriptState (string relPath) |
| The function updates the script state in the GEDI project view. More... | |
HspScript is a class for the CTRL script actions.
|
protected |
The function adds a CTRL script and its PID to a list of running scripts.
| path | The given script full path. |
| public int HspScript::createExample | ( | ) |
The function creates an example for a library.
| Value | Description |
|---|---|
| 0 | Success |
| -1 | An example cannot be created since it already exists. |
| -2 | An example cannot be created since this script is not a library. |
| -3 | An example cannot be created since the user does not have the neccessary permission. |
| public int HspScript::createUnitTest | ( | ) |
The function creates a unit test for the library.
| Value | Description |
|---|---|
| 0 | Success |
| -1 | A unit test cannot be created since it already exists. |
| -2 | A unit test cannot be created since the script is not a library. |
| -3 | A unit test cannot be created since the user does not have the neccessary permission. |
| public bool HspScript::exampleExist | ( | ) |
The function checks if an example for a CTRL script exists.
|
protected |
The function returns the CTRL class name by the file name.
The function removes invalid chars (only alphanumeric are allowed).
| public string HspScript::getCoverageReportPath | ( | ) |
The function returns the relative path to the coverage report.
|
static |
The function returns a line delimiter with a fixed length.
| spaces | Spaces on the left of the delimiter. |
| public string HspScript::getExampleFullPath | ( | ) |
The function returns the full path to the example of the specified CTRL script.
| Empty | string- if an example does not exist. |
| public string HspScript::getExampleRelPath | ( | ) |
The function returns the relative path to the example of the specified CTRL script.
The path is returned in unix format.
| public string HspScript::getFileName | ( | ) |
The function returns the file name of a CTRL script.
| public string HspScript::getFilePath | ( | ) |
The function returns the relative path to a CTRL script.
The absolute path is cut and the relative path is returned.
| public string HspScript::getFileRelPath | ( | ) |
The function returns the relative path to a CTRL script in a native format.
The path is relative to the project.
| public dyn_string HspScript::getGuiTestFullPaths | ( | ) |
Returns all GUI test script paths for the current panel.
| public string HspScript::getGuiTestRelPath | ( | ) |
Returns the default GUI test directory for the current panel file.
| public string HspScript::getScript | ( | ) |
The function returns the content of a CTRL script.
| public string HspScript::getUnitTestFullPath | ( | ) |
The function returns the full path to the example of the specified script.
| Empty | string - if an example does not exist. |
| public string HspScript::getUnitTestRelPath | ( | ) |
The function returns the relative path to the unit test of the specified CTRL script.
The Path is returned in unix format.
| public bool HspScript::guiTestExist | ( | ) |
Checks whether at least one GUI test exists for the current panel.
| public bool HspScript::isEmpty | ( | ) |
The function checks if a CTRL script is empty.
| public bool HspScript::isNewFile | ( | ) |
The function checks if a CTRL script file is empty (0 byte).
| public bool HspScript::isPartOf | ( | const string & | scriptType | ) |
The function checks the CTRL script part of the given relative path.
| scriptType | Script type. The relative path such as:
|
| public bool HspScript::isRunning | ( | const string | path | ) |
The function checks if the given script is running.
| path | The script path (could be a relative or a full path). |
| public void HspScript::makeFileHeader | ( | ) |
The function creates a mini header for a CTRL script.
The header is used if a template is not found. See also makeScriptFromTemplate()
| public int HspScript::makeScriptFromTemlate | ( | const string & | templateRelPath | ) |
The function creates a new CTRL script from the given template.
| templateRelPath | A relative (or full) path to the template. |
|
protected |
The function removes a CTRL script from the list of running scripts.
| path | The path of the script to be removed. |
| public int HspScript::replaceKey | ( | const string & | key, |
| const string & | value | ||
| ) |
The function replaces given keys by value in a CTRL script.
The function only changes the content of a cTRL script. The function does not save the script.
| key | Key for the search. |
| value | Value to be replaced. |
| public int HspScript::setFilePath | ( | const string & | path | ) |
The function sets a path to this CTRL script.
| path | The full path to this CTRL script. |
| Value | Description |
|---|---|
| 0 | Success |
| -1 | An invalid path |
| public void HspScript::setScript | ( | const string & | script | ) |
The Function sets the content of a CTRL script.
The function does not save the script. It only sets the content in this object. The script must not be parsable.
| script | Script content. |
| public void HspScript::showErrMsg | ( | const anytype & | msg | ) |
The function shows a message in the CTRL script editor.
| msg | The Message to be shown. |
|
protected |
The function starts the system call with the given script path and options.
The system call contains a WCCOActrl.exe, 'given script path' and 'given options'.
| relPath | Relative or full script path to start. |
| addOptions | Additional command-line options. |
| doCoverage | Enables coverage options when TRUE. |
| public int HspScript::startExample | ( | string | relPath = "", |
| string | addOptions = "" |
||
| ) |
The function starts an example for the library.
| relPath | The path to the example script file. If the path is not specified, it will be defined by using the getExampleRelPath() function. |
| addOptions | The options you want to start your example with. |
| Value | Description |
|---|---|
| 0 | Success |
| -1 | An example cannot be started since a new process could not be created. |
| private int HspScript::startGuiTest | ( | string | relPath, |
| string | addOptions | ||
| ) |
Starts a single GUI test script.
| relPath | Relative or full path to GUI test script. |
| addOptions | Additional process options. |
| public int HspScript::startGuiTests | ( | string | relPath = "", |
| string | addOptions = "" |
||
| ) |
Starts one or all GUI tests for the current panel.
| relPath | Optional relative/full path to one GUI test script. |
| addOptions | Additional process options. |
| public int HspScript::startUnitTest | ( | string | relPath = "", |
| string | addOptions = "" |
||
| ) |
The function starts a unit test for the library.
| relPath | The path to the unit test script file. If the path is not specified, it will be defined by using the function getUnitTestRelPath(). |
| addOptions | The options you want to start your unit test with. |
| Value | Description |
|---|---|
| 0 | Success |
| -1 | A unit test cannot be started since a new process could not be created. |
| public int HspScript::stopRunningScript | ( | const string | path | ) |
The function stops the given script.
| path | The script path (can be a relative or a full path). |
| Value | Description |
|---|---|
| 0 | Successful. |
| -1 | The script cannot be stopped. Its path is empty or it is not running. |
|
protected |
The function returns a relative path.
A full path must be specified as a parameter. The function cuts the relative path out of the full path.
| fullPath | The full path to be cut. |
| relPath | The relative path. |
| public int HspScript::trimLeadingSpace | ( | ) |
The function removes all leading spaces from the lines in a CTRL script.
| public int HspScript::trimTrailingSpace | ( | ) |
The function removes all trailing spaces from the lines in a CTRL script.
| public bool HspScript::unitTestExist | ( | ) |
The function checks if a uni test exists.
|
protected |
The function updates the script state in the GEDI project view.
| relPath | The path of the script to be updated. |