devel/lua-lunitx: New port

Lunitx is a unit testing framework for lua, written in lua,
based heavily on Lunit 0.5, but modified to work with Lua 5.2.
Lunitx provides 27 assert functions, and a few misc functions
for usage in an easy unit testing framework.
Lunit comes with a test suite to test itself. The testsuite
consists of approximately 710 assertions.

The port is required test of lua-sqlite3.

PR:		286201
This commit is contained in:
Pat Maddox 2025-04-20 19:08:34 +02:00 committed by Zsolt Udvari
parent 6777cfda5f
commit e45d0ff3a1
5 changed files with 69 additions and 0 deletions

View file

@ -1636,6 +1636,7 @@
SUBDIR += lua-luacheck
SUBDIR += lua-luarocks
SUBDIR += lua-lunit
SUBDIR += lua-lunitx
SUBDIR += lua-mode
SUBDIR += lua-posix
SUBDIR += lua-pty

51
devel/lua-lunitx/Makefile Normal file
View file

@ -0,0 +1,51 @@
PORTNAME= lunitx
DISTVERSION= 0.8.1
CATEGORIES= devel
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX}
MAINTAINER= pat@patmaddox.com
COMMENT= Extended version of lunit, a unit testing framework for Lua
WWW= https://github.com/dcurrie/lunit
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= lua:52-54
USE_GITHUB= yes
GH_ACCOUNT= dcurrie
GH_PROJECT= lunit
CONFLICTS= lua${LUA_FLAVOR}-lunit
NO_BUILD= yes
PORTDOCS= DOCUMENTATION README README.lunitx
PORTEXAMPLES= examples/*
OPTIONS_DEFINE= DOCS EXAMPLES
LUNIT_FILES= lunit.lua lunitx.lua lunit/console.lua lunitx/atexit.lua
do-install:
@${MKDIR} ${STAGEDIR}${LUA_MODSHAREDIR}
.for lunit_part in ${LUNIT_FILES}
@${MKDIR} ${STAGEDIR}${LUA_MODSHAREDIR}/${lunit_part:H}
${INSTALL_DATA} ${WRKSRC}/lua/${lunit_part} ${STAGEDIR}${LUA_MODSHAREDIR}/${lunit_part}
.endfor
@${MKDIR} ${STAGEDIR}${DOCSDIR}
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
post-install-DOCS-on:
.for f in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/
.endfor
post-install-EXAMPLES-on:
${INSTALL_DATA} ${WRKSRC}/${PORTEXAMPLES} ${STAGEDIR}${EXAMPLESDIR}/
do-test:
cd ${WRKSRC}/lua && ${LUA_CMD} ${WRKSRC}/test/selftest.lua
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
TIMESTAMP = 1745054415
SHA256 (dcurrie-lunit-0.8.1_GH0.tar.gz) = e571ff01cb8f8f77dceeb098359bc5d7f5b4b696023e3b9d5ee1b4c3d986ac32
SIZE (dcurrie-lunit-0.8.1_GH0.tar.gz) = 18030

View file

@ -0,0 +1,6 @@
Lunitx is a unit testing framework for lua, written in lua,
based heavily on Lunit 0.5, but modified to work with Lua 5.2.
Lunitx provides 27 assert functions, and a few misc functions
for usage in an easy unit testing framework.
Lunit comes with a test suite to test itself. The testsuite
consists of approximately 710 assertions.

View file

@ -0,0 +1,8 @@
%%LUA_MODSHAREDIR%%/lunit.lua
%%LUA_MODSHAREDIR%%/lunit/console.lua
%%LUA_MODSHAREDIR%%/lunitx.lua
%%LUA_MODSHAREDIR%%/lunitx/atexit.lua
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/both.lua
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/down.lua
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example.lua
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/up.lua