summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lua-zlib/tap.lua
blob: 05266a9c997d3173273c621e34846645d68827ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local tap_module = {}

local os = require("os")

local counter = 1
local failed  = false

function tap_module.ok(assert_true, desc)
   local msg = ( assert_true and "ok " or "not ok " ) .. counter
   if ( not assert_true ) then
      failed = true
   end
   if ( desc ) then
      msg = msg .. " - " .. desc
   end
   print(msg)
   counter = counter + 1
end

function tap_module.exit()
   os.exit(failed and 1 or 0)
end

return tap_module