Next: General, Previous: Setting up the Lua Scripter, Up: Using LuaScripter for creating scripted test cases
In order to use user created test code with Lua Scripter it is necessary to use MIN test module which is compliant with Lua: the Lua test class module.
A new Lua test class can be easily created with MIN Test Module Template Wizard that comes with the MIN release
$createtestmodule
A new Lua test class is now created with the given name to the given path. The next step is to create the building block methods to the test class.
To create the building block methods to the Lua test class:
/<testclassname>/src/<testclassname>Cases.c
file (there is one example method, that can be copy-pasted).
ts_get_test_cases (<testclassname>Cases.c)
:
ENTRY(*list,"Example",ExampleTest);
LOCAL int ExampleTest( lua_State *l );
/<testclassname>
directory by using build.sh
script. It will automatically copy test class library to /home/<user name>/.min
.
Now the Lua test class is created. The next step is to implement test cases to test the test case file used by Lua Scripter. An example test case file can be found in /<testclassname>/Example.lua
. The test case file is constructed using the script language defined in this chapter.
Copy the test case file to /home/<user name>/.min/
Now you should be able to execute your test class module by using console UI or EXT INTERFACE.