Allow test or suite to be specified on command line

This commit is contained in:
Jason Perkins 2012-04-18 17:12:56 -04:00
parent b930597f58
commit c8d493e569
2 changed files with 13 additions and 2 deletions

View File

@ -180,12 +180,23 @@
-- Register a test action
--
newoption {
trigger = "test",
description = "A suite or test to run"
}
newaction {
trigger = "test",
description = "Run the automated test suite",
execute = function ()
passed, failed = test.runall()
if _OPTIONS["test"] then
local t = string.explode(_OPTIONS["test"] or "", ".", true)
passed, failed = test.runall(t[1], t[2])
else
passed, failed = test.runall()
end
msg = string.format("%d tests passed, %d failed", passed, failed)
if (failed > 0) then
error(msg, 0)

View File

@ -1,2 +1,2 @@
#!/bin/sh
../bin/debug/premake4 /scripts=../src test
../bin/debug/premake4 /scripts=../src $1 $2 $3 test