Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/e6989b67942c51725f0d1307e32703078266358c
>---------------------------------------------------------------
commit e6989b67942c51725f0d1307e32703078266358c
Author: Shmuel Zeigerman <
solo...@gmail.com>
Date: Sun May 26 08:23:35 2024 +0300
Add command macro:test (lm:test) for automatic testing
>---------------------------------------------------------------
e6989b67942c51725f0d1307e32703078266358c
appveyor.yml | 2 +-
plugins/luamacro/_globalinfo.lua | 2 +-
plugins/luamacro/changelog | 4 ++++
plugins/luamacro/luafar/version.h | 2 +-
plugins/luamacro/luamacro.lua | 12 ++++++++++++
5 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/appveyor.yml b/appveyor.yml
index 67230be59..6e6065c77 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -141,7 +141,7 @@ after_build:
#test & archive
- cd ci\%configuration%.%platform_name%
#Run macrotest.lua, on failure %ERRORLEVEL% is non zero
- - if not "%platform_name%" == "ARM64" Far.exe -service "lua:far.MacroPost([=[R=win.GetEnv('FARHOME');R=R or os.exit(1); R=R..[[\Plugins\LuaMacro\macrotest.lua]]; R=loadfile(R);R=R or os.exit(2); OK,R=pcall(R);OK=OK or os.exit(3); OK,R=pcall(R.test_all);os.exit(OK and 0 or 4);]=],nil,'CtrlShiftF12')"
+ - Far.exe -service "macro:test"
#set NAME_PREFIX variable as otherwise it is not available when artifacts are collected
- set NAME_PREFIX="Far%NAME_ADD%.%platform_name%.%appveyor_build_version%.%APPVEYOR_REPO_COMMIT%"
- appveyor SetVariable -Name NAME_PREFIX -Value "%NAME_PREFIX%"
diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua
index 4678debe4..9e6158241 100644
--- a/plugins/luamacro/_globalinfo.lua
+++ b/plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
- Version = { 3, 0, 0, 835 },
+ Version = { 3, 0, 0, 836 },
MinFarVersion = { 3, 0, 0, 6327 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
diff --git a/plugins/luamacro/changelog b/plugins/luamacro/changelog
index f5c01e887..9a3b90db1 100644
--- a/plugins/luamacro/changelog
+++ b/plugins/luamacro/changelog
@@ -1,3 +1,7 @@
+shmuel 2024-05-26 08:19:05+03:00 - build 836
+
+1. Add command macro:test (lm:test) for automatic testing.
+
shmuel 2024-05-20 01:24:46+03:00 - build 835
1. LuaFAR: fix the last commit.
diff --git a/plugins/luamacro/luafar/version.h b/plugins/luamacro/luafar/version.h
index 22792cfa7..39d4fb1fa 100644
--- a/plugins/luamacro/luafar/version.h
+++ b/plugins/luamacro/luafar/version.h
@@ -1,3 +1,3 @@
#include <farversion.hpp>
-#define PLUGIN_BUILD 835
+#define PLUGIN_BUILD 836
diff --git a/plugins/luamacro/luamacro.lua b/plugins/luamacro/luamacro.lua
index 8172ee3b3..c6af67bc1 100644
--- a/plugins/luamacro/luamacro.lua
+++ b/plugins/luamacro/luamacro.lua
@@ -353,6 +353,18 @@ local function Open_CommandLine (strCmdLine)
utils.UnloadMacros()
elseif cmd == "about" then
About()
+ elseif cmd == "test" then
+ far.MacroPost( [[
+ local function Quit(n) actl.Quit(n) Keys("Esc") end
+ local OK, R
+ R = win.JoinPath(far.PluginStartupInfo().ModuleDir, "macrotest.lua")
+ R = loadfile(R) or Quit(1)
+ OK, R = pcall(R)
+ OK = OK or Quit(2)
+ R.test_all = R.test_all or Quit(3)
+ OK = pcall(R.test_all)
+ Quit(OK and 0 or 4)
+ ]], 0, "CtrlShiftF12")
elseif cmd == "browser" then
macrobrowser()
elseif cmd ~= "" then