aboutsummaryrefslogtreecommitdiff
path: root/test/README.md
blob: c374438f0baa39ff4da08cc245d670cff86114e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#LuaRocks testsuite
##Overview
Test suite for LuaRocks project with Busted unit testing framework(http://olivinelabs.com/busted/). 

* Contains white-box & black-box tests
* Easy setup for your purpose on command line or from configuration file


## Dependencies
* Lua >= 5.1 
* Busted with dependencies


##Usage
Running of tests is based on basic Busted usage. *-Xhelper* flag is mandatory for inserting arguments into testing (primary black-box). Flag *--tags=* or *-t* is mandatory for specifying which tests will run. Mandatory *-Xhelper* flag always needs version of Lua or LuaJIT (e.g. *lua=5.2.4* or *luajit=2.0.3*). Start tests inside LuaRocks folder or specify with *-C* flag.

**Arguments for Busted helper script**

```
lua=<version>, !mandatory! type your full version of Lua (e.g. lua=5.2.4)
OR
luajit=<version>, !mandatory! type your full version of LuaJIT (e.g. luajit=5.2.4)

env=<type>,	(default:"minimal") type what kind of environment to use ["minimal", "full"]
clean,	remove existing testing environment
travis,  add just if running on TravisCI
os=<version>,    type your OS ["linux", "os x", "windows"]
```
---------------------------------------------------------------------------------------------
####_**Tags** of tests are required and are in this format:_

**whitebox** - run all whitebox tests

**blackbox** - run all blackbox tests

**ssh** - run all tests which require ssh

**w**\_*name-of-command* - whitebox testing of command

**b**\_*name-of-command* - blackbox testing of command

for example: `b_install`  or `w_help`

###Examples
To run white-box tests in LuaRocks directory type :

`busted -t "whitebox"`

To run black-box tests just of *install* command (we defined our OS, so OS check is skipped.):

`busted -Xhelper lua=5.2.4,os=linux -t "b_install"`

To run black-box tests of *install* command, whitebox of *help* command (using *full* type of environment):

`busted -Xhelper lua=5.2.4,env=full -t "b_install", "w_help"`

To run black-box tests without tests, which use ssh:

`busted -Xhelper lua=5.2.4 -t "blackbox" --exclude-tags=ssh`