Can't get dub dustmite to work

Andre Pany andre at s-e-a-p.de
Sat Apr 25 18:52:45 UTC 2020


On Saturday, 25 April 2020 at 09:38:59 UTC, aliak wrote:
> Trying to get dub dustmite to work, but I keep getting "initial 
> test fails"
>
> This is the error from a vanilla dub test:
>
> ```
> result ~wip: building configuration "result-test-unittest"...
> inout(SumType!(int, FailureContainer))
> ../../.dub/packages/sumtype-0.9.4/sumtype/src/sumtype.d(1322,4): Error: static assert:  "handler #1 of type Optional!(Exception) function(FailureContainer container) pure nothrow @nogc @safe never matches"
> ../../.dub/packages/sumtype-0.9.4/sumtype/src/sumtype.d(1165,14):
>        instantiated from here: matchImpl!(inout(SumType!(int, 
> FailureContainer)))
> source/result/result.d(136,20):        instantiated from here: 
> match!(inout(SumType!(int, FailureContainer)))
> tests/result.d(20,20):        instantiated from here: 
> Result!(int, Exception)
> dmd failed with exit code 1.
> ```
>
> Then I run this dub dustmite command:
>
> dub dustmite -b unittest ../dubdust --compiler-regex="never 
> matches"
>
> And I get:
>
> ```
> ...
> Loading /Users/aliak/dev/dubdust/vibe-d/web/vibe/web/web.d
> None => No
> Hint: use --no-redirect to see test script output
> Hint: read 
> https://github.com/CyberShadow/DustMite/wiki#initial-test-fails
> object.Exception at DustMite/dustmite.d(295): Initial test fails: 
> Test script "/usr/local/Cellar/dub/1.20.0/bin/dub dustmite 
> --vquiet --test-package=result --build=unittest 
> --config=library \"--compiler=dmd\" \"--compiler-regex=never 
> matches\"" exited with exit code 3 (failure)
> ```
>
> * --no-redirect doesn't work in dub dustmite.
> * I tried adding --compiler-status=1 with the same result
> * I tired --combined with the same result
>
> My dub.json for the unittest configuration is (incase that 
> matters):
>         {
>             "name": "unittest",
>             "importPaths": [
>                 "./tests"
>             ],
>             "sourcePaths": [
>                 "./tests"
>             ]
>         },
>
> Thanks for any help!

How do you call dub test causing the issue? Maybe there is a 
difference in the configuration/build type.

Also a side remark. You cannot use the output of dmd when 
colouring is on. Dmd lies because the backticks used for 
colouring are not shown. But without them, regex search is 
failing.

I also wonder whether dub Dustmite should be enhanced to search 
for a plain text too. Because while using regex search there 
might be characters which have a regex meaning while user just 
want a simple text search. This could also cause issues.

Kind regards
Andre



More information about the Digitalmars-d-learn mailing list