diff --git a/app.lua b/app.lua index 1bf5c43..7126588 100644 --- a/app.lua +++ b/app.lua @@ -438,6 +438,14 @@ function App.run_tests() App = saved_app end +function App.run_test(test) + local saved_app = App + App = App_for_tests + App.initialize_for_test() + xpcall(test, function(err) prepend_debug_info_to_test_failure('', err) end) + App = saved_app +end + -- prepend file/line/test function prepend_debug_info_to_test_failure(test_name, err) local err_without_line_number = err:gsub('^[^:]*:[^:]*: ', '')