fix tests

This commit is contained in:
Vadim A. Misbakh-Soloviov 2017-04-09 13:59:14 +07:00
parent c943629e1f
commit a7ae1ec77b
No known key found for this signature in database
GPG Key ID: 26503D349B3B334B
2 changed files with 11 additions and 7 deletions

View File

@ -28,9 +28,10 @@ install:
- luarocks make rockspecs/htmlparser-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage" - luarocks make rockspecs/htmlparser-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
script: script:
- cd tst # - cd tst
- lua -e "print(require'cURL'.version())" - lua -e "print(require'cURL'.version())"
- lunit.sh init.lua # - lunit.sh init.lua
- lua -l tst -e ""
after_success: after_success:
- coveralls -b .. -r .. -i ./src --dump c.report.json - coveralls -b .. -r .. -i ./src --dump c.report.json

View File

@ -8,16 +8,19 @@ print("Lua version: " .. (jit and jit.version or _VERSION))
print("------------------------------------") print("------------------------------------")
print("") print("")
local HAS_RUNNER = not not lunitx local HAS_RUNNER = not not lunit
local lunitx = require("lunitx") local lunitx
if not HAS_RUNNER then
lunitx = require"lunitx"
else
lunitx = require"lunit"
end
local TEST_CASE = lunitx.TEST_CASE local TEST_CASE = lunitx.TEST_CASE
local LUA_VER = _VERSION local LUA_VER = _VERSION
local unpack, pow, bit32 = unpack, math.pow, bit32 local unpack, pow, bit32 = unpack, math.pow, bit32
local _ENV = TEST_CASE"some_test_case" local _ENV = TEST_CASE"html"
module("html", lunitx.testcase, package.seeall)
local htmlparser = require("htmlparser") local htmlparser = require("htmlparser")