You may be able to use `include` instead of `import` for this purpose.

Note that `include` and `import` have different semantics. With `include`, you 
have basically textual inclusion. This means that multiple includes will 
replicate procedures and variables each time. However, if you're only using it 
for unit tests, that may already be sufficient.

In addition, this allows you to keep separate modules with and without testing 
and without duplicating code. For example:

  1. Put your basic modules into a directory `modules/base` (or whatever path 
you like).
  2. Create a separate directory `modules/withtests` that contains one module 
for each in `modules/base`, where the testable one includes the original via 
`include ../base/original` and adds tests as needed.
  3. Compile with `--path` set to either `modules/base` or `modules/withtests` 
depending on whether you're building a release or test version.


Reply via email to