Loading...
Searching...
No Matches
robottestingframework::plugin::LuaPluginLoaderImpl Class Reference

The LuaPluginLoaderImpl loads an test case plug-in and gives the direct access to the TestCase. More...

`#include <robottestingframework/lua/impl/LuaPluginLoader_impl.h>`

Inheritance diagram for robottestingframework::plugin::LuaPluginLoaderImpl:
[legend]

## Public Member Functions

| LuaPluginLoaderImpl ()
| LuaPluginLoaderImpl constructor.
| ~LuaPluginLoaderImpl () override
| LuaPluginLoaderImpl destructor.
TestCase * | open (const std::string filename)
| open Loads a test case plugin
void | close ()
| close Unloads the plugin and deletes any allocated memory.
std::string | getLastError ()
| getLastError gets the last error if any.
std::string | getFileName ()
| getFileName returns the loaded script file name
void | setTestName (const std::string name)
| setTestName set the test case name
bool | setup (int argc, char **argv) override
| setup is called before the test run.
void | tearDown () override
| tearDown is called after the test run
void | run () override
| run is called by the TestCase class if setup is successfull;
Public Member Functions inherited from robottestingframework::TestCase
| TestCase (std::string name, std::string param="")
| TestCase constructor.
virtual | ~TestCase ()
| TestCase destructor.
void | interrupt () override
| interrupt interrupts the current test run
void | run (TestResult &rsl) override
| the main caller of a TestCase inherited from Test Class.
bool | succeeded () const override
| succeeded
void | failed ()
| failed Sets the test successful flag to `false` which indicates that the test was not successful.
TestResult * | getResult ()
| getResult Returns an instance of TestResult if run(TestResult &result) has been already called by a TestRunner
void | setParam (const std::string param)
| setParam Sets the optional parameters of the test.
std::string | getParam ()
| getParam gets the original paramter string which is set for the test case
void | setEnvironment (const std::string environment)
| setEnvironment Optioanlly specifies the environment in which the test case is executed.
std::string | getEnvironment ()
| getParam gets the environment string which is set for the test case
void | setRepetition (unsigned int rep)
| setRepetition sets the run repetition by default the run() method is called only once; The number of test runs (e.g., for stress testing) can be set using this function.
unsigned int | getRepetition ()
| getRepetition gets the tun repetition
Public Member Functions inherited from robottestingframework::Test
| Test (std::string name, std::string description="")
| Test constructor.
virtual | ~Test ()
| Test destructor.
const std::string | getName () const
| getName Getting test name.
const std::string | getDescription () const
| getDescription Getting test description
void | setDescription (const std::string description)
| setDescription Sets an optional string which describes the test.

## Private Member Functions

bool | getLocalFunction (const char *name)
bool | registerExtraFunctions (void)
std::string | extractFileName (const std::string &path)

## Static Private Member Functions

static int | setName (lua_State *L)
static int | assertError (lua_State *L)
static int | assertFail (lua_State *L)
static int | testReport (lua_State *L)
static int | testFail (lua_State *L)
static int | testCheck (lua_State *L)
static int | getTestEnvironment (lua_State *L)

## Private Attributes

lua_State * | L
std::string | filename
std::string | error

## Static Private Attributes

static const struct luaL_reg | luaPluginLib []

## Additional Inherited Members

Protected Member Functions inherited from robottestingframework::Test
void | setName (std::string name)
| setName setting the test name

## Detailed Description

The LuaPluginLoaderImpl loads an test case plug-in and gives the direct access to the TestCase.

Definition at line 38 of file LuaPluginLoader_impl.h.

## Constructor & Destructor Documentation

## LuaPluginLoaderImpl()

robottestingframework::plugin::LuaPluginLoaderImpl::LuaPluginLoaderImpl | ( |  | ) |

LuaPluginLoaderImpl constructor.

## ~LuaPluginLoaderImpl()

robottestingframework::plugin::LuaPluginLoaderImpl::~LuaPluginLoaderImpl | ( |  | ) |

override

LuaPluginLoaderImpl destructor.

## Member Function Documentation

## assertError()

static int robottestingframework::plugin::LuaPluginLoaderImpl::assertError | ( | lua_State * | L | ) |

static private

## assertFail()

static int robottestingframework::plugin::LuaPluginLoaderImpl::assertFail | ( | lua_State * | L | ) |

static private

## close()

void robottestingframework::plugin::LuaPluginLoaderImpl::close | ( |  | ) |

close Unloads the plugin and deletes any allocated memory.

## extractFileName()

std::string robottestingframework::plugin::LuaPluginLoaderImpl::extractFileName | ( | const std::string & | path | ) |

private

## getFileName()

std::string robottestingframework::plugin::LuaPluginLoaderImpl::getFileName | ( |  | ) |

getFileName returns the loaded script file name

Returns
  the script file name

## getLastError()

std::string robottestingframework::plugin::LuaPluginLoaderImpl::getLastError | ( |  | ) |

getLastError gets the last error if any.

Returns
  returns the last error string.

## getLocalFunction()

bool robottestingframework::plugin::LuaPluginLoaderImpl::getLocalFunction | ( | const char * | name | ) |

private

## getTestEnvironment()

static int robottestingframework::plugin::LuaPluginLoaderImpl::getTestEnvironment | ( | lua_State * | L | ) |

static private

## open()

TestCase * robottestingframework::plugin::LuaPluginLoaderImpl::open | ( | const std::string | filename | ) |

open Loads a test case plugin

Parameters

  filename | the plugin filename

Returns
  A pointer to the test case loaded from the plugin or a null pointer in case of failure.

## registerExtraFunctions()

bool robottestingframework::plugin::LuaPluginLoaderImpl::registerExtraFunctions | ( | void |  | ) |

private

## run()

void robottestingframework::plugin::LuaPluginLoaderImpl::run | ( |  | ) |

override virtual

run is called by the TestCase class if setup is successfull;

Implements robottestingframework::TestCase.

## setName()

static int robottestingframework::plugin::LuaPluginLoaderImpl::setName | ( | lua_State * | L | ) |

static private

## setTestName()

void robottestingframework::plugin::LuaPluginLoaderImpl::setTestName | ( | const std::string | name | ) |

setTestName set the test case name

Parameters

  name | the test case name

## setup()

bool robottestingframework::plugin::LuaPluginLoaderImpl::setup | ( | int | argc,
|  | char ** | argv
| ) |  |

override virtual

setup is called before the test run.

Note
  the first value in argv is the name of the current testcases

Parameters

  argc | The number of the pasred argument from string paramter
  argv | The arguments which is parsed using string paramter

Returns
  true or false depending of the test initialization

Reimplemented from robottestingframework::TestCase.

## tearDown()

void robottestingframework::plugin::LuaPluginLoaderImpl::tearDown | ( |  | ) |

override virtual

tearDown is called after the test run

Reimplemented from robottestingframework::TestCase.

## testCheck()

static int robottestingframework::plugin::LuaPluginLoaderImpl::testCheck | ( | lua_State * | L | ) |

static private

## testFail()

static int robottestingframework::plugin::LuaPluginLoaderImpl::testFail | ( | lua_State * | L | ) |

static private

## testReport()

static int robottestingframework::plugin::LuaPluginLoaderImpl::testReport | ( | lua_State * | L | ) |

static private

## Member Data Documentation

## error

std::string robottestingframework::plugin::LuaPluginLoaderImpl::error

private

Definition at line 107 of file LuaPluginLoader_impl.h.

## filename

std::string robottestingframework::plugin::LuaPluginLoaderImpl::filename

private

Definition at line 106 of file LuaPluginLoader_impl.h.

## L

lua_State* robottestingframework::plugin::LuaPluginLoaderImpl::L

private

Definition at line 105 of file LuaPluginLoader_impl.h.

## luaPluginLib

const struct luaL_reg robottestingframework::plugin::LuaPluginLoaderImpl::luaPluginLib[]

static private

Definition at line 111 of file LuaPluginLoader_impl.h.

The documentation for this class was generated from the following file:

- src/plugins/lua/include/robottestingframework/lua/impl/LuaPluginLoader_impl.h