aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gendeclarations.lua31
-rw-r--r--scripts/genoptions.lua1
-rwxr-xr-xscripts/legacy2luatest.pl2
3 files changed, 18 insertions, 16 deletions
diff --git a/scripts/gendeclarations.lua b/scripts/gendeclarations.lua
index 4e74e4e301..637f4cdffa 100755
--- a/scripts/gendeclarations.lua
+++ b/scripts/gendeclarations.lua
@@ -239,23 +239,24 @@ end
non_static = non_static .. footer
static = static .. footer
-local F
-F = io.open(static_fname, 'w')
-F:write(static)
-F:close()
--- Before generating the non-static headers, check if the current file(if
--- exists) is different from the new one. If they are the same, we won't touch
--- the current version to avoid triggering an unnecessary rebuilds of modules
+-- Before generating the headers, check if the current file (if exists) is
+-- different from the new one. If they are the same, we won't touch the
+-- current version to avoid triggering an unnecessary rebuilds of modules
-- that depend on this one
-F = io.open(non_static_fname, 'r')
-if F ~= nil then
- if F:read('*a') == non_static then
- os.exit(0)
+local update_changed = function (fname, contents)
+ local F = io.open(fname, 'r')
+ if F ~= nil then
+ if F:read('*a') == contents then
+ return
+ end
+ io.close(F)
end
- io.close(F)
+
+ F = io.open(fname, 'w')
+ F:write(contents)
+ F:close()
end
-F = io.open(non_static_fname, 'w')
-F:write(non_static)
-F:close()
+update_changed(static_fname, static)
+update_changed(non_static_fname, non_static)
diff --git a/scripts/genoptions.lua b/scripts/genoptions.lua
index 2859ca1795..da53d010bd 100644
--- a/scripts/genoptions.lua
+++ b/scripts/genoptions.lua
@@ -39,6 +39,7 @@ local redraw_flags={
local list_flags={
comma='P_COMMA',
+ onecomma='P_ONECOMMA',
flags='P_FLAGLIST',
flagscomma='P_COMMA|P_FLAGLIST',
}
diff --git a/scripts/legacy2luatest.pl b/scripts/legacy2luatest.pl
index ebd8dad1e1..8155353fc7 100755
--- a/scripts/legacy2luatest.pl
+++ b/scripts/legacy2luatest.pl
@@ -287,7 +287,7 @@ local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
describe('$test_name', function()
- setup(clear)
+ before_each(clear)
it('is working', function()
@{[join "\n", map { /^$/ ? '' : ' ' . $_ } @{$test_body_lines}]}