diff options
| author | ruki <[email protected]> | 2026-08-15 14:02:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-08-15 14:02:04 +0800 |
| commit | 9926b3eb72c04382dd91e92d9c44fb03767e859e (patch) | |
| tree | 7ca1df454aacaad9e3734b1a775d66dafe55453f /tests/actions/addon | |
| parent | 7cb21509f2a72f00927c4c5c53f3bbb884b8f7a0 (diff) | |
improve to install addons from repo
Diffstat (limited to 'tests/actions/addon')
| -rw-r--r-- | tests/actions/addon/test.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/actions/addon/test.lua b/tests/actions/addon/test.lua index d1e054598..192230b08 100644 --- a/tests/actions/addon/test.lua +++ b/tests/actions/addon/test.lua @@ -368,7 +368,8 @@ end -- the addons can be installed from a repository, by plain name and by repo@name function test_install_from_repo(t) - local recipes = {["custom-plugin"] = ("set_sourcedir(%q)"):format(_addondir("custom-plugin"))} + local recipes = {["custom-plugin"] = ("set_sourcedir(%q)"):format(_addondir("custom-plugin")), + ["custom-module"] = ("set_sourcedir(%q)"):format(_addondir("custom-module"))} _with_repo(recipes, function (reponame) os.runv("xmake", {"addon", "--install", "-y", "custom-plugin"}) t:require(os.iorunv("xmake", {"hello_addon"}):find("hello from custom-plugin", 1, true)) @@ -384,6 +385,13 @@ function test_install_from_repo(t) -- t:require(os.iorunv("xmake", {"addon", "--search", "custom-plugin"}):find("custom-plugin", 1, true)) t:require_not(os.iorunv("xmake", {"lua", "private.xrepo", "search", "custom-plugin"}):find("custom-plugin", 1, true)) + + -- and several of them can be installed in one shot, they are resolved and installed together + os.runv("xmake", {"addon", "--remove", "--force", "custom-plugin"}) + os.runv("xmake", {"addon", "--install", "-y", "custom-plugin", reponame .. "@custom-module"}) + t:require(os.iorunv("xmake", {"hello_addon"}):find("hello from custom-plugin", 1, true)) + t:require(os.iorunv("xmake", {"lua", "-c", "import(\"@addon.custom-module.greeting\"); print(greeting(\"xmake\"))"}) + :find("hello from custom-module: xmake", 1, true)) end) end |
