skip crashing tests and mark them as failed

develop
Myk Taylor 2023-09-25 17:34:38 -07:00
parent cc49c07870
commit 30e3b695a1
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

@ -31,7 +31,7 @@ if args.test_dir is not None:
if not os.path.isdir(args.test_dir): if not os.path.isdir(args.test_dir):
print('ERROR: invalid test folder: %r' % args.test_dir) print('ERROR: invalid test folder: %r' % args.test_dir)
MAX_TRIES = 1 MAX_TRIES = 5
dfhack = 'Dwarf Fortress.exe' if sys.platform == 'win32' else './dfhack' dfhack = 'Dwarf Fortress.exe' if sys.platform == 'win32' else './dfhack'
test_status_file = 'test_status.json' test_status_file = 'test_status.json'

@ -645,12 +645,13 @@ local function run_tests(tests, status, counts, config)
goto skip goto skip
end end
end end
-- pre-emptively mark the test as failed in case we induce a crash
status[test.full_name] = TestStatus.FAILED
save_test_status(status)
if run_test(test, status, counts) then if run_test(test, status, counts) then
status[test.full_name] = TestStatus.PASSED status[test.full_name] = TestStatus.PASSED
else save_test_status(status)
status[test.full_name] = TestStatus.FAILED
end end
save_test_status(status)
::skip:: ::skip::
end end
local elapsed_ms = dfhack.getTickCount() - start_ms local elapsed_ms = dfhack.getTickCount() - start_ms