Merge pull request #7423 from alehander42/feature-disable-param-filtering
Unittest param filtering
This commit is contained in:
commit
916ce09c80
1 changed files with 6 additions and 1 deletions
|
|
@ -150,6 +150,7 @@ var
|
||||||
checkpoints {.threadvar.}: seq[string]
|
checkpoints {.threadvar.}: seq[string]
|
||||||
formatters {.threadvar.}: seq[OutputFormatter]
|
formatters {.threadvar.}: seq[OutputFormatter]
|
||||||
testsFilters {.threadvar.}: HashSet[string]
|
testsFilters {.threadvar.}: HashSet[string]
|
||||||
|
disabledParamFiltering {.threadvar.}: bool
|
||||||
|
|
||||||
when declared(stdout):
|
when declared(stdout):
|
||||||
abortOnError = existsEnv("NIMTEST_ABORT_ON_ERROR")
|
abortOnError = existsEnv("NIMTEST_ABORT_ON_ERROR")
|
||||||
|
|
@ -379,7 +380,7 @@ proc ensureInitialized() =
|
||||||
if formatters == nil:
|
if formatters == nil:
|
||||||
formatters = @[OutputFormatter(defaultConsoleFormatter())]
|
formatters = @[OutputFormatter(defaultConsoleFormatter())]
|
||||||
|
|
||||||
if not testsFilters.isValid:
|
if not disabledParamFiltering and not testsFilters.isValid:
|
||||||
testsFilters.init()
|
testsFilters.init()
|
||||||
when declared(paramCount):
|
when declared(paramCount):
|
||||||
# Read tests to run from the command line.
|
# Read tests to run from the command line.
|
||||||
|
|
@ -701,3 +702,7 @@ macro expect*(exceptions: varargs[typed], body: untyped): untyped =
|
||||||
errorTypes.add(exp[i])
|
errorTypes.add(exp[i])
|
||||||
|
|
||||||
result = getAst(expectBody(errorTypes, exp.lineinfo, body))
|
result = getAst(expectBody(errorTypes, exp.lineinfo, body))
|
||||||
|
|
||||||
|
proc disableParamFiltering* =
|
||||||
|
## disables filtering tests with the command line params
|
||||||
|
disabledParamFiltering = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue