Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return status code after testing #2069

Merged
merged 3 commits into from
Apr 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,7 @@ foreach($fileName in $fileEntries)
if($args[0] -eq "run"){
Write-Host "Running Journey to the Center of Hawkthorne..."
.\bin\love-0.9.1-win32\love.exe src
}elseif($args[0] -eq "test"){
Write-Host "Testing Journey to the Center of Hawkthorne..."
.\bin\love-0.9.1-win32\love.exe src --test --console
}
4 changes: 2 additions & 2 deletions src/test/lovetest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function lovetest.run()
end
end

local opts = {verbose=true}
opts.quit_on_failure = love._os == "Windows"
local opts = {verbose=false}
opts.quit_on_failure = love._os ~= "Windows"
lunatest.run(nil, opts)

if love._os ~= "Windows" then
Expand Down
9 changes: 7 additions & 2 deletions src/test/lunatest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,16 @@ end
---Run all known test suites, with given configuration hooks.
-- @param hooks Override the default hooks.
-- @param opts Override command line arguments.
-- opts is expected to be a table of options. Recognized options:
-- opts.verbose - if true and no hooks are provided the verbose_hooks will be used
-- opts.quit_on_failure - if true and some tests fail, terminates the program
-- with status code equal to the number of failures
-- for additional options see {@link run_suite}
-- @usage If no hooks are provided and arg[1] == "-v", the verbose_hooks will
-- be used. opts is expected to be a table of command line arguments.
-- be used.
function run(hooks, opts)
-- also check the namespace it's run in
local opts = opts and cmd_line_switches(opts) or cmd_line_switches(lt_arg)
local opts = opts or cmd_line_switches(lt_arg)

-- Make stdout line-buffered for better interactivity when the output is
-- not going to the terminal, e.g. is piped to another program.
Expand Down