2020-09-20 20:13:07 +02:00
|
|
|
local Command = require 'utils.command'
|
|
|
|
local Runner = require 'utils.test.runner'
|
|
|
|
local Viewer = require 'utils.test.viewer'
|
|
|
|
|
|
|
|
Command.add(
|
|
|
|
'test-runner',
|
|
|
|
{
|
|
|
|
description = "Runs tests and opens the test runner, use flag 'open' to skip running tests first.",
|
|
|
|
arguments = {'open'},
|
2020-09-29 21:50:24 +02:00
|
|
|
default_values = {open = false},
|
|
|
|
allowed_by_server = false
|
2020-09-20 20:13:07 +02:00
|
|
|
},
|
|
|
|
function(args, player)
|
|
|
|
local open = args.open
|
|
|
|
if open == 'open' or open == 'o' then
|
|
|
|
Viewer.open(player)
|
2020-09-29 21:50:24 +02:00
|
|
|
else
|
|
|
|
Runner.run_module(nil, player)
|
2020-09-20 20:13:07 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|