aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Maddox <pat@patmaddox.com>2025-04-20 17:08:34 +0000
committerZsolt Udvari <uzsolt@FreeBSD.org>2025-04-20 17:10:22 +0000
commite45d0ff3a1555d92ce2c302999cef7841f0766bf (patch)
tree2f337c74fab5adc24cf4551a9e06cabc9fc36af2
parent6777cfda5fa113aad143394cb349b5def8fc0c54 (diff)
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
-rw-r--r--devel/Makefile1
-rw-r--r--devel/lua-lunitx/Makefile51
-rw-r--r--devel/lua-lunitx/distinfo3
-rw-r--r--devel/lua-lunitx/pkg-descr6
-rw-r--r--devel/lua-lunitx/pkg-plist8
5 files changed, 69 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 85d671dffdaf..5d63a47613bf 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -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
diff --git a/devel/lua-lunitx/Makefile b/devel/lua-lunitx/Makefile
new file mode 100644
index 000000000000..0e7d7aab7046
--- /dev/null
+++ b/devel/lua-lunitx/Makefile
@@ -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>
diff --git a/devel/lua-lunitx/distinfo b/devel/lua-lunitx/distinfo
new file mode 100644
index 000000000000..58dc78c0ffed
--- /dev/null
+++ b/devel/lua-lunitx/distinfo
@@ -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
diff --git a/devel/lua-lunitx/pkg-descr b/devel/lua-lunitx/pkg-descr
new file mode 100644
index 000000000000..3fa0b43c5a21
--- /dev/null
+++ b/devel/lua-lunitx/pkg-descr
@@ -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.
diff --git a/devel/lua-lunitx/pkg-plist b/devel/lua-lunitx/pkg-plist
new file mode 100644
index 000000000000..8a17ecdb368b
--- /dev/null
+++ b/devel/lua-lunitx/pkg-plist
@@ -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