Merge pull request #300905 from teto/teto/fix-lua-setup-hook
lua.tests.checkSetupHook: test lua setup hook for http package
This commit is contained in:
commit
f7ae598e45
|
@ -25,7 +25,8 @@ addToLuaSearchPathWithCustomDelimiter() {
|
||||||
# export only if the folder contains lua files
|
# export only if the folder contains lua files
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
|
|
||||||
for _file in ${absPattern/\?/\*\*}; do
|
local adjustedPattern="${absPattern/\?/\*\*\/\*}"
|
||||||
|
for _file in $adjustedPattern; do
|
||||||
export "${varName}=${!varName:+${!varName};}${absPattern}"
|
export "${varName}=${!varName:+${!varName};}${absPattern}"
|
||||||
shopt -u globstar
|
shopt -u globstar
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -66,6 +66,21 @@ in
|
||||||
touch $out
|
touch $out
|
||||||
'');
|
'');
|
||||||
|
|
||||||
|
# checks that lua's setup-hook adds dependencies to LUA_PATH
|
||||||
|
# Prevents the following regressions
|
||||||
|
# $ env NIX_PATH=nixpkgs=. nix-shell --pure -Q -p luajitPackages.lua luajitPackages.http
|
||||||
|
# nix-shell$ luajit
|
||||||
|
# > require('http.request')
|
||||||
|
# stdin:1: module 'http.request' not found:
|
||||||
|
checkSetupHook = pkgs.runCommandLocal "test-${lua.name}-setup-hook" ({
|
||||||
|
nativeBuildInputs = [lua];
|
||||||
|
buildInputs = [ lua.pkgs.http ];
|
||||||
|
meta.platforms = lua.meta.platforms;
|
||||||
|
}) (''
|
||||||
|
${lua}/bin/lua -e "require'http.request'"
|
||||||
|
touch $out
|
||||||
|
'');
|
||||||
|
|
||||||
checkRelativeImports = pkgs.runCommandLocal "test-${lua.name}-relative-imports" ({
|
checkRelativeImports = pkgs.runCommandLocal "test-${lua.name}-relative-imports" ({
|
||||||
}) (''
|
}) (''
|
||||||
source ${./assert.sh}
|
source ${./assert.sh}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user