From 73c942af628c99b9def3a1d7f9b02ce8976dcda9 Mon Sep 17 00:00:00 2001 From: AlfonZ42 Date: Mon, 31 Mar 2014 12:35:51 +0200 Subject: [PATCH 1/2] lunatest: Fix handling of custom options. Keep verbose mode disabled. --- src/test/lovetest.lua | 4 ++-- src/test/lunatest.lua | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/test/lovetest.lua b/src/test/lovetest.lua index 7452f48ea..944e39f79 100644 --- a/src/test/lovetest.lua +++ b/src/test/lovetest.lua @@ -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 diff --git a/src/test/lunatest.lua b/src/test/lunatest.lua index 7357915cd..1cd9acd6e 100644 --- a/src/test/lunatest.lua +++ b/src/test/lunatest.lua @@ -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. From 2a960feb36690e0ee77917ac483372492de96acf Mon Sep 17 00:00:00 2001 From: AlfonZ42 Date: Mon, 31 Mar 2014 12:36:12 +0200 Subject: [PATCH 2/2] make.ps1: Add new argument 'test' for running the tests (on Windows) --- make.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/make.ps1 b/make.ps1 index 16ce69d0a..543cfa72d 100644 --- a/make.ps1 +++ b/make.ps1 @@ -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.0-win32\love.exe src +}elseif($args[0] -eq "test"){ + Write-Host "Testing Journey to the center of Hawkthorne..." + .\bin\love-0.9.0-win32\love.exe src --test --console }