On Wednesday, 17 February 2016 at 09:05:34 UTC, Atila Neves wrote:
I'm on a tablet on holiday so sorry in advance for the short answer.

You're on a holiday, I appreciate anything you write :)

Your versioned import is the reason why I made it so a plain string UDA is just as good as @Name. That way you only need to import unit_threaded once in a version block, and only if you want to use the shouldXXX assertions.

Nice. What about @ShoudFail though?

The test runner you mentioned can be generated by using my dtest tool, also on dub.

I saw it, does it integrate well with `dub test` and -cov?

The next thing on my TODO list is to make it even easier to opt-in to using unit-threaded without having to change existing project code

I feel you are almost there.

For completeness, here is my testrunner generator that dub's preBuildCommands calls:

void main(string[] args)
        import std.file;
        import std.algorithm : endsWith, startsWith, filter, map, joiner;
        import std.array : replace;
        import std.range : array;
        bool onlyDFiles(DirEntry e)
                return !e.isDir() && e.name.endsWith(".d");
auto files = dirEntries("source/es5", SpanMode.depth).filter!onlyDFiles.map!("a.name").map!(`"\""~a~"\""`).joiner(",").array().replace("/",".").replace("\\",".").replace("source.","").replace(".d","");
        import std.stdio;
        writeln("Generating TestRunner");
        auto f = File("source/testrunner.d","w");
        f.write(`version (unittest)
        bool runner()
                import testhelpers;
                import core.runtime;
                return runTests!(`~files~`)(Runtime.args) == 0;
        static this()
                import core.runtime;
                Runtime.moduleUnitTester = &runner;

Reply via email to