> What I ended up with was just using include to merge all my tests together in 
> one file and executing that. A macro generates the include statements so I do 
> not have to update my tests/all.nim file.

I do the same, or even write small tests in the same file as the code. All you 
need is to define the `test` somewhere, say in `mylib/test.nim`
    
    
    template test*(name: string, body) =
      if env["test", "false"] == "true":
        body
    
    
    Run

And then use it whenever you want:
    
    
    ...
    
    test "range":
      check range(-1.0, 1.0, 4) == @[-1.0, -0.5, 0.0, 0.5, 1.0]
    
    ...
    
    
    Run

Reply via email to