File: README

package info (click to toggle)
trafficserver 9.2.5%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 53,008 kB
  • sloc: cpp: 345,484; ansic: 31,134; python: 24,200; sh: 7,271; makefile: 3,045; perl: 2,261; java: 277; pascal: 119; sql: 94; xml: 2
file content (27 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download | duplicates (4)
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
Notes on Unit Testing Lua scripts for ATS Lua Plugin

Follow the steps below to use busted framework to run some unit tests on sample scripts and modules

1) Build and install lua 5.1.5 using the source code from here - http://www.lua.org/ftp/lua-5.1.tar.gz

2) Build and install luarocks 2.2.2 from here - https://github.com/keplerproject/luarocks/wiki/Download

3) Run "sudo luarocks install busted"

4) Run "sudo luarocks install luacov"

5) "cd trafficserver/plugins/experimental/ts_lua/ci"

6) Run "busted -c module_test.lua; luacov". It will produce "luacov.report.out" containing the code coverage on
"module.lua"

7) Run "busted -c script_test.lua; luacov". It will produce "luacov.report.out" containing the code coverage on
"script.lua"

Reference for further information
1) Busted - http://olivinelabs.com/busted/

2) Specifications for asserts/mocks/stubs/etc inside busted framework -
https://github.com/Olivine-Labs/luassert/tree/master/spec

3) luacov - https://luarocks.org/modules/hisham/luacov