Loading pkgs/development/interpreters/lua-5/tests/default.nix +29 −37 Original line number Diff line number Diff line Loading @@ -10,10 +10,10 @@ let lua: { name, command }: pkgs.runCommandLocal "test-${lua.name}-${name}" ({ { nativeBuildInputs = [ lua ]; meta.platforms = lua.meta.platforms; }) } ( '' source ${./assert.sh} Loading Loading @@ -58,9 +58,9 @@ let ";./?.lua;${lua}/share/luajit-2.1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;${lua}/share/lua/5.1/?.lua;${lua}/share/lua/5.1/?/init.lua;"; }; in pkgs.recurseIntoAttrs ({ pkgs.recurseIntoAttrs { checkInterpreterPatch = checkInterpreterPath = let golden_LUA_PATH = golden_LUA_PATHS.${lib.versions.majorMinor lua.version}; in Loading @@ -73,14 +73,10 @@ pkgs.recurseIntoAttrs ({ ''; }; checkWrapping = pkgs.runCommandLocal "test-${lua.name}-wrapping" ({ }) ('' checkWrapping = pkgs.runCommandLocal "test-${lua.name}-wrapping" { } '' grep -- 'LUA_PATH=' ${wrappedHello}/bin/hello touch $out ''); ''; # checks that lua's setup-hook adds dependencies to LUA_PATH # Prevents the following regressions Loading @@ -90,21 +86,17 @@ pkgs.recurseIntoAttrs ({ # 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} lua_vanilla_package_path="$(${lua}/bin/lua -e "print(package.path)")" Loading @@ -117,18 +109,18 @@ pkgs.recurseIntoAttrs ({ assertStringContains "$lua_with_module_package_path" "./?/init.lua" touch $out ''); ''; # Check that a lua package's propagatedBuildInputs end up in LUA_PATH checkPropagatedBuildInputs = pkgs.runCommandLocal "test-${lua.name}-setup-hook" ({ # lua-curl is a propagatedBuildInput of rest-nvim has { buildInputs = [ lua.pkgs.rest-nvim ]; }) ('' ${lua}/bin/lua -e "require'cURL'" } # `xml2lua` is a propagatedBuildInput of rest-nvim '' ${lua}/bin/lua -e "require'xml2lua'" touch $out ''); ''; }) } Loading
pkgs/development/interpreters/lua-5/tests/default.nix +29 −37 Original line number Diff line number Diff line Loading @@ -10,10 +10,10 @@ let lua: { name, command }: pkgs.runCommandLocal "test-${lua.name}-${name}" ({ { nativeBuildInputs = [ lua ]; meta.platforms = lua.meta.platforms; }) } ( '' source ${./assert.sh} Loading Loading @@ -58,9 +58,9 @@ let ";./?.lua;${lua}/share/luajit-2.1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;${lua}/share/lua/5.1/?.lua;${lua}/share/lua/5.1/?/init.lua;"; }; in pkgs.recurseIntoAttrs ({ pkgs.recurseIntoAttrs { checkInterpreterPatch = checkInterpreterPath = let golden_LUA_PATH = golden_LUA_PATHS.${lib.versions.majorMinor lua.version}; in Loading @@ -73,14 +73,10 @@ pkgs.recurseIntoAttrs ({ ''; }; checkWrapping = pkgs.runCommandLocal "test-${lua.name}-wrapping" ({ }) ('' checkWrapping = pkgs.runCommandLocal "test-${lua.name}-wrapping" { } '' grep -- 'LUA_PATH=' ${wrappedHello}/bin/hello touch $out ''); ''; # checks that lua's setup-hook adds dependencies to LUA_PATH # Prevents the following regressions Loading @@ -90,21 +86,17 @@ pkgs.recurseIntoAttrs ({ # 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} lua_vanilla_package_path="$(${lua}/bin/lua -e "print(package.path)")" Loading @@ -117,18 +109,18 @@ pkgs.recurseIntoAttrs ({ assertStringContains "$lua_with_module_package_path" "./?/init.lua" touch $out ''); ''; # Check that a lua package's propagatedBuildInputs end up in LUA_PATH checkPropagatedBuildInputs = pkgs.runCommandLocal "test-${lua.name}-setup-hook" ({ # lua-curl is a propagatedBuildInput of rest-nvim has { buildInputs = [ lua.pkgs.rest-nvim ]; }) ('' ${lua}/bin/lua -e "require'cURL'" } # `xml2lua` is a propagatedBuildInput of rest-nvim '' ${lua}/bin/lua -e "require'xml2lua'" touch $out ''); ''; }) }