File: tap.lua

package info (click to toggle)
lua-zlib 0.2%2Bgit%2B1%2B9622739-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 120 kB
  • ctags: 60
  • sloc: ansic: 284; makefile: 44
file content (21 lines) | stat: -rw-r--r-- 402 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local os = require("os")
module(..., package.seeall)

local counter = 1
local failed  = false

function 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 exit()
   os.exit(failed and 1 or 0)
end