title: Unit Testing in Nim: Is it possible to get the name of a source file at compile time?
body: <p>I'm planning a project with multiple modules, and I was looking for a nice solution to run all existing unit tests in the project at once. I came up with the following idea: I can run <code>nim --define:testing main.nim</code> and use the following template as a wrapper for all my unit tests.</p>
  
  <pre><code># located in some general utils module:
  template runUnitTests*(code: stmt): stmt =
    when defined(testing):
      echo "Running units test in ..."
      code
  </code></pre>
  
  <p>This seems to be working well so far.</p>
  
  <p>As a minor tweak, I was wondering if I can actually print out the file name which is calling the <code>runUnitTests</code> template. Is there any reflection mechanism to get the source file name at compile time?</p>