Merge branch 'develop' into myk_move_main

develop
lethosor 2021-03-23 22:17:36 -04:00
commit 29a396ba54
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
4 changed files with 27 additions and 9 deletions

@ -454,10 +454,25 @@ local function run_tests(tests, status, counts)
save_test_status(status)
end
local function print_summary_line(ok, message)
local print_fn = print
if not ok then
status['*'] = TestStatus.FAILED
print_fn = dfhack.printerr
end
print_fn(message)
end
status['*'] = status['*'] or TestStatus.PASSED
print('\nTest summary:')
print(('%d/%d tests passed'):format(counts.tests_ok, counts.tests))
print(('%d/%d checks passed'):format(counts.checks_ok, counts.checks))
print(('%d test files failed to load'):format(counts.file_errors))
print_summary_line(counts.tests_ok == counts.tests,
('%d/%d tests passed'):format(counts.tests_ok, counts.tests))
print_summary_line(counts.checks_ok == counts.checks,
('%d/%d checks passed'):format(counts.checks_ok, counts.checks))
print_summary_line(counts.file_errors == 0,
('%d test files failed to load'):format(counts.file_errors))
save_test_status(status)
end
local function main(args)

@ -1 +1 @@
Subproject commit ad1c98cf852936694300eaf8d69e91c10b7ea57f
Subproject commit 9a936001d9095681d5cb6225eb18bfe0ed2bcf28

@ -1 +1 @@
Subproject commit 8200539a851623bfc8a049390633a5fa3cc55b84
Subproject commit c74d5ebeee50e1f14758d4c389b3221ea4c556f6

@ -3,7 +3,7 @@ local utils = require('utils')
function test.unit_action_fields()
dfhack.with_temp_object(df.unit_action:new(), function(action)
for k in pairs(action.data) do
expect.eq(utils.addressof(action.data.raw_data), utils.addressof(action.data[k]),
expect.eq(utils.addressof(action.data.raw_data), utils.addressof(action.data:_field(k)),
'address of ' .. k .. ' does not match')
end
end)
@ -11,9 +11,12 @@ end
function test.unit_action_type()
dfhack.with_temp_object(df.unit_action:new(), function(action)
for k, v in ipairs(df.unit_action_type) do
expect.true_(action.data[df.unit_action_type.attrs[k].tag])
expect.true_(action.data[df.unit_action_type.attrs[v].tag])
for index, name in ipairs(df.unit_action_type) do
expect.true_(name, "unit_action_type entry without name: " .. tostring(index))
local tag = df.unit_action_type.attrs[name].tag
expect.true_(tag, "unit_action_type entry missing tag: name=" .. name)
expect.pairs_contains(action.data, tag,
"unit_action_type entry missing from unit_action.data: name=" .. name)
end
end)
end