summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAlexander Ivanov <alehander42@gmail.com>2018-03-27 19:23:08 +0300
committerAlexander Ivanov <alehander42@gmail.com>2018-03-27 19:23:08 +0300
commit53088c05cb3e67f6d27f9639335a7d5e1057a42e (patch)
treea2017e1851df6cd929df3da8621c0415552754d1 /lib
parent50229293ae5898acc2c30f9cb87b59e2fa0b236a (diff)
downloadNim-53088c05cb3e67f6d27f9639335a7d5e1057a42e.tar.gz
Disable param filtering
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/unittest.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim
index fbce087ff..0034d0c60 100644
--- a/lib/pure/unittest.nim
+++ b/lib/pure/unittest.nim
@@ -150,6 +150,7 @@ var
   checkpoints {.threadvar.}: seq[string]
   formatters {.threadvar.}: seq[OutputFormatter]
   testsFilters {.threadvar.}: HashSet[string]
+  disabledParamFiltering {.threadvar.}: bool
 
 when declared(stdout):
   abortOnError = existsEnv("NIMTEST_ABORT_ON_ERROR")
@@ -379,7 +380,7 @@ proc ensureInitialized() =
   if formatters == nil:
     formatters = @[OutputFormatter(defaultConsoleFormatter())]
 
-  if not testsFilters.isValid:
+  if not disabledParamFiltering and not testsFilters.isValid:
     testsFilters.init()
     when declared(paramCount):
       # Read tests to run from the command line.
@@ -701,3 +702,7 @@ macro expect*(exceptions: varargs[typed], body: untyped): untyped =
     errorTypes.add(exp[i])
 
   result = getAst(expectBody(errorTypes, exp.lineinfo, body))
+
+proc disableParamFiltering* =
+  ## disables filtering tests with the command line params
+  disabledParamFiltering = true