Skip to content

Commit

Permalink
[fix]: update tests that uses c api
Browse files Browse the repository at this point in the history
  • Loading branch information
castlele committed Dec 27, 2024
1 parent 182f156 commit 87c8ee0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ jobs:
with:
luarocksVersion: "3.0.0"

- name: build
run: |
luarocks make
- name: test
run: |
luarocks make
./run_tests.sh "*"
deploy:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
check_report.txt
.cache/
**/*.o
**/*.so
cluautils/*
4 changes: 0 additions & 4 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ tests_dir=./tests
FILTER=$1
IS_ANY_ERROR=0

make clean
make build
make test_thread

for test_file in $tests_dir/${FILTER}.lua; do
lua $test_file

Expand Down
9 changes: 8 additions & 1 deletion tests/cmemory_tests.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
local t = require("src.tests")
local memory = assert(package.loadlib("./src/memory/bin/memory.so", "_luaopen_cluautils_memory"))()
local localMemoryPackage = package.loadlib("./src/memory/bin/memory.so", "_luaopen_cluautils_memory")
local memory

if not localMemoryPackage then
memory = require("cluautils.memory")
else
memory = localMemoryPackage()
end

t.describe("Memory module tests", function ()
t.it("Memory module gets address of the table", function ()
Expand Down
9 changes: 8 additions & 1 deletion tests/cthread_tests.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
require("src.file_manager.file_manager")
local t = require("src.tests")
local thread = assert(package.loadlib("./src/threads/bin/thread.so", "_luaopen_cluautils_thread"))()
local localThreadPackage = package.loadlib("./src/threads/bin/thread.so", "_luaopen_cluautils_thread")
local thread

if not localThreadPackage then
thread = require("cluautils.thread")
else
thread = localThreadPackage()
end

t.describe("Thread Module Tests", function ()
---@param maxValue integer?
Expand Down

0 comments on commit 87c8ee0

Please sign in to comment.