From 91a3b03359980210cf81e479f741e5f027bc141d Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 27 Nov 2019 12:53:12 -0800 Subject: [PATCH] ;test: update command line help --- hledger/Hledger/Cli/Commands.hs | 6 +++++- hledger/Hledger/Cli/Commands/Test.md | 29 ++++++++++++++------------- hledger/Hledger/Cli/Commands/Test.txt | 27 +++++++++++++------------ 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/hledger/Hledger/Cli/Commands.hs b/hledger/Hledger/Cli/Commands.hs index 57fb2ffd5..cddb36c22 100644 --- a/hledger/Hledger/Cli/Commands.hs +++ b/hledger/Hledger/Cli/Commands.hs @@ -258,12 +258,16 @@ testmode = hledgerCommandMode [] [generalflagsgroup3] [] - ([], Just $ argsFlag "[TESTPATTERN] [SEED]") + ([], Just $ argsFlag "[-- TASTYOPTS]") -- | The test command. -- Unlike most hledger commands, this one does not read the user's journal. -- A 'Journal' argument remains in the type signature, but it should -- not be used (and would raise an error). +-- +-- This command also accepts tasty test runner options, +-- written after a -- (double hyphen). +-- testcmd :: CliOpts -> Journal -> IO () testcmd opts _undefined = do withArgs (words' $ query_ $ reportopts_ opts) $ diff --git a/hledger/Hledger/Cli/Commands/Test.md b/hledger/Hledger/Cli/Commands/Test.md index 78111ba92..789bdae91 100644 --- a/hledger/Hledger/Cli/Commands/Test.md +++ b/hledger/Hledger/Cli/Commands/Test.md @@ -3,19 +3,20 @@ Run built-in unit tests. _FLAGS_ -This command runs the unit tests built in to hledger-lib and hledger, -printing test names and results on stdout. If any test fails, the -exit code will be non-zero. +This command runs the unit tests built in to hledger and hledger-lib, +printing the results on stdout. If any test fails, the exit code will +be non-zero. -Test names include a group prefix. If a (exact, case sensitive) group -prefix, or a full test name is provided as the first argument, only -that group or test is run. +This is mainly used by hledger developers, but you can also use it to +sanity-check the installed hledger executable on your platform. All +tests are expected to pass - if you ever see a failure, please report +as a bug! -If a numeric second argument is provided, it will set the randomness -seed, for repeatable results from tests using randomness (currently -none of them). - -This is mainly used by developers, but it's nice to be able to -sanity-check your installed hledger executable at any time. All tests -are expected to pass - if you ever see otherwise, something has gone -wrong, please report a bug! +This command also accepts tasty test runner options, written after a +-- (double hyphen). Eg to run only the tests in Hledger.Data.Amount, +with ANSI colour codes disabled: +```shell +$ hledger test -- -pData.Amount --color=never +``` +For help on these, see https://github.com/feuerbach/tasty#options +(`-- --help` currently doesn't show them). diff --git a/hledger/Hledger/Cli/Commands/Test.txt b/hledger/Hledger/Cli/Commands/Test.txt index 7ccfe6fb3..661e47fc7 100644 --- a/hledger/Hledger/Cli/Commands/Test.txt +++ b/hledger/Hledger/Cli/Commands/Test.txt @@ -3,19 +3,20 @@ Run built-in unit tests. _FLAGS_ -This command runs the unit tests built in to hledger-lib and hledger, -printing test names and results on stdout. If any test fails, the exit -code will be non-zero. +This command runs the unit tests built in to hledger and hledger-lib, +printing the results on stdout. If any test fails, the exit code will be +non-zero. -Test names include a group prefix. If a (exact, case sensitive) group -prefix, or a full test name is provided as the first argument, only that -group or test is run. +This is mainly used by hledger developers, but you can also use it to +sanity-check the installed hledger executable on your platform. All +tests are expected to pass - if you ever see a failure, please report as +a bug! -If a numeric second argument is provided, it will set the randomness -seed, for repeatable results from tests using randomness (currently none -of them). +This command also accepts tasty test runner options, written after a -- +(double hyphen). Eg to run only the tests in Hledger.Data.Amount, with +ANSI colour codes disabled: -This is mainly used by developers, but it's nice to be able to -sanity-check your installed hledger executable at any time. All tests -are expected to pass - if you ever see otherwise, something has gone -wrong, please report a bug! +$ hledger test -- -pData.Amount --color=never + +For help on these, see https://github.com/feuerbach/tasty#options +(-- --help currently doesn't show them).