Can't get dub dustmite to work

Anonymouse zorael at gmail.com
Mon Apr 27 07:23:17 UTC 2020


On Sunday, 26 April 2020 at 22:05:20 UTC, aliak wrote:
> On Saturday, 25 April 2020 at 19:00:55 UTC, Anonymouse wrote:
>> On Saturday, 25 April 2020 at 09:38:59 UTC, aliak wrote:
>>> Then I run this dub dustmite command:
>>>
>>> dub dustmite -b unittest ../dubdust --compiler-regex="never 
>>> matches"
>>
>> I have had zero luck with dustmite via dub. I would honestly 
>> recommend that you create a shell script that does `dub test 
>> 2>&1 | grep "never matches"`, and just use that as a tester 
>> with dustmite directly.
>
> Ok I got it working with that but it resulted in the wrong 
> output (it was a bad test case basically" But expanding the 
> shell script to
>
> dub test 2>&1 | grep 'Error: static assert:  \"handler #0 of 
> type `Optional!(Exception) function(FailureContainer container) 
> pure nothrow @nogc @safe` never matches\"'
>
> now results in
>
> ...
> Loading ./source/result/failure.d
> Loading ./source/result/package.d
> Loading ./source/result/result.d
> Loading ./tests/result.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 "dub test 2>&1 | grep 'Error: static assert:  
> \"handler #0 of type  never matches\"'" exited with exit code 1 
> (failure)
> ----------------
> ??:? _Dmain [0x10c56cf5e]
>
>
> This is the full dustmite command:
>
> dustmite --force . "dub test 2>&1 | grep 'Error: static assert:
>  \"handler #0 of type `Optional!(Exception) 
> function(FailureContainer container) pure nothrow @nogc @safe` 
> never matches\"'"

I'm not at the computer but I expect what's happening is backtick 
command substitution. It's difficult to get right since you want 
to nest quotes here, but you may be able to get around it by just 
escaping the backticks too. The easy solution is a shell script. 
I'll test it some more once I have something better to type on 
than the phone.


More information about the Digitalmars-d-learn mailing list