mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-03-13 17:42:29 +01:00
Move lua environment detection to its own file and source in the test scripts
This commit is contained in:
tests
16
tests/env.sh
Normal file
16
tests/env.sh
Normal file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
which luarocks && eval $(luarocks path)
|
||||
which luarocks-5.3 && eval $(luarocks-5.3 path)
|
||||
|
||||
if [[ -d /usr/share/minetest ]]; then
|
||||
export LUANTI_PATH=/usr/share/minetest
|
||||
elif [[ -d /usr/share/luanti ]]; then
|
||||
export LUANTI_PATH=/usr/share/luanti
|
||||
else
|
||||
echo "Unable to find luanti/minetest path, cannot run tests"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LUACHECK=$HOME/.luarocks/bin/luacheck
|
||||
LUA=$( which lua || which lua5.1 || which lua5.2 || which lua5.3 || which luajit )
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
source tests/env.sh
|
||||
set -e
|
||||
LUA=$( which lua || which lua5.1 || which lua5.2 || which lua5.3 || which luajit )
|
||||
|
||||
# Make sure luanti lls definitions are up-to-date
|
||||
(
|
||||
|
@ -1,19 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
which luarocks && eval $(luarocks path)
|
||||
which luarocks-5.3 && eval $(luarocks-5.3 path)
|
||||
source tests/env.sh
|
||||
set -e
|
||||
|
||||
if [[ -d /usr/share/minetest ]]; then
|
||||
export LUANTI_PATH=/usr/share/minetest
|
||||
elif [[ -d /usr/share/luanti ]]; then
|
||||
export LUANTI_PATH=/usr/share/luanti
|
||||
else
|
||||
echo "Unable to find luanti/minetest path, cannot run tests"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LUACHECK=$HOME/.luarocks/bin/luacheck
|
||||
LUA=$( which lua || which lua5.1 || which lua5.2 || which lua5.3 || which luajit )
|
||||
if [[ -z "$LUA" ]]; then
|
||||
echo "Unable to find lua interpreter"
|
||||
exit 1
|
||||
|
@ -1,10 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
source tests/env.sh
|
||||
set -e
|
||||
|
||||
which luarocks && eval $(luarocks path)
|
||||
which luarocks-5.3 && eval $(luarocks-5.3 path)
|
||||
|
||||
find ./ -name 'mod.conf' | sort | while read MOD; do
|
||||
(
|
||||
set -e
|
||||
|
Reference in New Issue
Block a user