diff --git a/tests/imports.nim b/tests/imports.nim index fbe642fc..6cbc52e5 100644 --- a/tests/imports.nim +++ b/tests/imports.nim @@ -2,13 +2,14 @@ import std/macros import std/os import std/strutils -macro importTests*(dir: static string): untyped = +macro importTests*(dir: static string, excludes: static string = ""): untyped = ## imports all files in the specified directory whose filename ## starts with "test" and ends in ".nim" let imports = newStmtList() + let excludeList = excludes.split(",") for file in walkDirRec(dir): let (_, name, ext) = splitFile(file) - if name.startsWith("test") and ext == ".nim": + if name.startsWith("test") and ext == ".nim" and not (name in excludeList): imports.add( quote do: import `file` diff --git a/tests/testIntegration.nim b/tests/testIntegration.nim index eef2f79e..17a1de7d 100644 --- a/tests/testIntegration.nim +++ b/tests/testIntegration.nim @@ -12,6 +12,11 @@ when includes != "": importAll(includes.split(",")) else: # import all tests in the integration/ directory - importTests(currentSourcePath().parentDir() / "integration") + importTests( + currentSourcePath().parentDir() / "integration" / "1_minute", "testpurchasing" + ) + importTests( + currentSourcePath().parentDir() / "integration" / "5_minutes", "testsales" + ) {.warning[UnusedImport]: off.}