- findModuleEntries
DirEntry[] findModuleEntries(Options options)
Undocumented in source. Be warned that the author may not have intended to support it.
- findModuleNames
string[] findModuleNames(Options options)
Undocumented in source. Be warned that the author may not have intended to support it.
- getGenUtOptions
Options getGenUtOptions(string[] args)
Undocumented in source. Be warned that the author may not have intended to support it.
- writeUtMainFile
string writeUtMainFile(string[] args)
Undocumented in source. Be warned that the author may not have intended to support it.
- writeUtMainFile
string writeUtMainFile(Options options)
Undocumented in source. Be warned that the author may not have intended to support it.
This module implements a template mixin containing a program to search a list of directories for all .d files therein, then writes a D program to run all unit tests in those files using unit_threaded. The program implemented by this mixin only writes out a D file that itself must be compiled and run.
To use this as a runnable program, simply mix in and compile:
Generally however, this code will be used by the gen_ut_main dub configuration via dub run.
By default, genUtMain will look for unit tests in CWD and write a program out to a temporary file. To change the file to write to, use the -f option. To change what directories to look in, simply pass them in as the remaining command-line arguments.
The resulting file is also a program that must be compiled and, when run, will run the unit tests found. By default, it will run all tests. To run one test or all tests in a particular package, pass them in as command-line arguments. The -h option will list all command-line options.
Examples (assuming the generated file is called ut.d):