[PR #38] [MERGED] fix importing luacov for tests running #38

Closed
opened 2026-06-06 22:10:46 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/vxcontrol/soldr-modules/pull/38
Author: @0legovich
Created: 12/29/2022
Status: Merged
Merged: 1/16/2023
Merged by: @asdek

Base: masterHead: fix-luacov-import


📝 Commits (1)

  • 89c123a fix importing luacov for tests running

📊 Changes

3 files changed (+33 additions, -1 deletions)

View changed files

📝 .gitignore (+2 -1)
tests_framework/lua/busted/modules/luacov.lua (+23 -0)
tests_framework/lua/luacov.lua (+8 -0)

📄 Description

Running tests according to the documentation gives an error.

Closes https://github.com/vxcontrol/soldr-modules/issues/37

Description of the Change

Steps to reproduce:

git clone git@github.com:vxcontrol/soldr-modules.git
cd soldr-modules
git submodule init
git submodule update
cd luapower/
./mgit clone git@github.com:vxcontrol/soldr-luapower-repos.git
./mgit clone-all

cd soldr-modules

export LUAPOWER_PLATFORM=osx64
export LUA_PATH="$(pwd)/tests_framework/lua/?.lua;$(pwd)/tests_framework/lua/?/init.lua;$(pwd)/luapower/?.lua;$(pwd)/luapower/?/init.lua;$(pwd)/utils/?.lua;$(pwd)/utils/?/init.lua"
export LUA_CPATH="$(pwd)/luapower/bin/$LUAPOWER_PLATFORM/lib?.dylib;$(pwd)/luapower/bin/$LUAPOWER_PLATFORM/clib/?.so;"
export LUA_BIN="$(pwd)/luapower/bin/$LUAPOWER_PLATFORM/luajit-bin"

./tests_framework/lua/bin/busted.$LUAPOWER_PLATFORM.cmd tests/.

Expected behaviour:

ARG[1] tests/.
...
N successes / 0 failures / 0 errors / 0 pending : 1.0 seconds

Actual behaviour:

ARG[1] tests/.
/soldr-modules/luapower/bin/osx64/luajit-bin: /soldr-modules/tests_framework/lua/busted/runner.lua:25: module 'busted.modules.luacov' not found:
	no field package.preload['busted.modules.luacov']
	no file '/soldr-modules/tests_framework/lua/busted/modules/luacov.lua'
	no file '/soldr-modules/tests_framework/lua/busted/modules/luacov/init.lua'
	no file '/soldr-modules/luapower/busted/modules/luacov.lua'
	no file '/soldr-modules/luapower/busted/modules/luacov/init.lua'
	no file '/soldr-modules/utils/busted/modules/luacov.lua'
	no file '/soldr-modules/utils/busted/modules/luacov/init.lua'
	no file '/soldr-modules/luapower/bin/osx64/libbusted/modules/luacov.dylib'
	no file '/soldr-modules/luapower/bin/osx64/clib/busted/modules/luacov.so'
	no file '/soldr-modules/luapower/bin/osx64/libbusted.dylib'
	no file '/soldr-modules/luapower/bin/osx64/clib/busted.so'
stack traceback:
	[C]: in function 'require'
	/soldr-modules/tests_framework/lua/busted/runner.lua:25: in function </soldr-modules/tests_framework/lua/busted/runner.lua:11>
	/soldr-modules/tests_framework/lua/bin/busted.lua:12: in main chunk
	[C]: at 0x010fbeb620

Changelog Entry

Fixed
Running unit tests according to the documentation https://github.com/vxcontrol/soldr-modules/wiki/Unit-testing#tests-starting

Checklist:

  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/vxcontrol/soldr-modules/pull/38 **Author:** [@0legovich](https://github.com/0legovich) **Created:** 12/29/2022 **Status:** ✅ Merged **Merged:** 1/16/2023 **Merged by:** [@asdek](https://github.com/asdek) **Base:** `master` ← **Head:** `fix-luacov-import` --- ### 📝 Commits (1) - [`89c123a`](https://github.com/vxcontrol/soldr-modules/commit/89c123afa7ca5b4d5b5e854d1e09b4521def64f6) fix importing luacov for tests running ### 📊 Changes **3 files changed** (+33 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -1) ➕ `tests_framework/lua/busted/modules/luacov.lua` (+23 -0) ➕ `tests_framework/lua/luacov.lua` (+8 -0) </details> ### 📄 Description Running tests according to the [documentation](https://github.com/vxcontrol/soldr-modules/wiki/Unit-testing#tests-starting) gives an error. Closes https://github.com/vxcontrol/soldr-modules/issues/37 ### Description of the Change Steps to reproduce: ``` git clone git@github.com:vxcontrol/soldr-modules.git cd soldr-modules git submodule init git submodule update cd luapower/ ./mgit clone git@github.com:vxcontrol/soldr-luapower-repos.git ./mgit clone-all cd soldr-modules export LUAPOWER_PLATFORM=osx64 export LUA_PATH="$(pwd)/tests_framework/lua/?.lua;$(pwd)/tests_framework/lua/?/init.lua;$(pwd)/luapower/?.lua;$(pwd)/luapower/?/init.lua;$(pwd)/utils/?.lua;$(pwd)/utils/?/init.lua" export LUA_CPATH="$(pwd)/luapower/bin/$LUAPOWER_PLATFORM/lib?.dylib;$(pwd)/luapower/bin/$LUAPOWER_PLATFORM/clib/?.so;" export LUA_BIN="$(pwd)/luapower/bin/$LUAPOWER_PLATFORM/luajit-bin" ./tests_framework/lua/bin/busted.$LUAPOWER_PLATFORM.cmd tests/. ``` Expected behaviour: ``` ARG[1] tests/. ... N successes / 0 failures / 0 errors / 0 pending : 1.0 seconds ``` Actual behaviour: ``` ARG[1] tests/. /soldr-modules/luapower/bin/osx64/luajit-bin: /soldr-modules/tests_framework/lua/busted/runner.lua:25: module 'busted.modules.luacov' not found: no field package.preload['busted.modules.luacov'] no file '/soldr-modules/tests_framework/lua/busted/modules/luacov.lua' no file '/soldr-modules/tests_framework/lua/busted/modules/luacov/init.lua' no file '/soldr-modules/luapower/busted/modules/luacov.lua' no file '/soldr-modules/luapower/busted/modules/luacov/init.lua' no file '/soldr-modules/utils/busted/modules/luacov.lua' no file '/soldr-modules/utils/busted/modules/luacov/init.lua' no file '/soldr-modules/luapower/bin/osx64/libbusted/modules/luacov.dylib' no file '/soldr-modules/luapower/bin/osx64/clib/busted/modules/luacov.so' no file '/soldr-modules/luapower/bin/osx64/libbusted.dylib' no file '/soldr-modules/luapower/bin/osx64/clib/busted.so' stack traceback: [C]: in function 'require' /soldr-modules/tests_framework/lua/busted/runner.lua:25: in function </soldr-modules/tests_framework/lua/busted/runner.lua:11> /soldr-modules/tests_framework/lua/bin/busted.lua:12: in main chunk [C]: at 0x010fbeb620 ``` ### Changelog Entry > Fixed Running unit tests according to the documentation https://github.com/vxcontrol/soldr-modules/wiki/Unit-testing#tests-starting ### Checklist: - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my change. - [ ] All new and existing tests pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-06 22:10:46 -04:00
yindo closed this issue 2026-06-06 22:10:46 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/soldr-modules#38