I suggest you add the following to your nimble file:
    
    
    ### Helper functions
    proc test(name: string, defaultLang = "c") =
      if not dirExists "build":
        mkDir "build"
      --run
      switch("out", ("./build/" & name))
      setCommand defaultLang, "tests/" & name & ".nim"
    
    ### tasks
    task test, "Run all tests":
      test "all_tests
    
    
    Run

And then in your test directory add a all_tests.nim file that imports all your 
individual tests. Now you can just type nimble test to run all your test suite.

Example repo with this setup:
    

  * simple version with one test only: 
[https://github.com/numforge/laser](https://github.com/numforge/laser)
  * complex version with dozens of tests: 
[https://github.com/mratsim/Arraymancer](https://github.com/mratsim/Arraymancer)


Reply via email to