Skip to content

Commit 92910e6

Browse files
committed
Make it run the tests on every found Lua version
1 parent 20e0983 commit 92910e6

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

test.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/bin/bash
2-
lua tests/init.lua
3-
if [ $? -ne 0 ]; then
4-
exit 1
5-
fi
2+
3+
# Define the versions of Lua and LuaJIT you want to test
4+
lua_versions=("lua5.1" "lua5.2" "lua5.3" "lua5.4" "luajit")
5+
6+
# Loop through each version and run the tests
7+
for version in "${lua_versions[@]}"; do
8+
# Check if the version is installed
9+
if command -v $version > /dev/null 2>&1; then
10+
echo "Running tests with $version..."
11+
$version tests/init.lua
12+
if [ $? -ne 0 ]; then
13+
echo "Tests failed with $version"
14+
exit 1
15+
fi
16+
else
17+
echo "$version is not installed"
18+
fi
19+
done
20+
21+
echo "All tests passed for all installed Lua versions"

0 commit comments

Comments
 (0)