Re: Can't get dub dustmite to work

2020-04-25 Thread Andre Pany via Digitalmars-d-learn

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@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



Re: Can't get dub dustmite to work

2020-04-25 Thread Anonymouse via Digitalmars-d-learn

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.


Re: Can't get dub dustmite to work

2020-04-26 Thread aliak via Digitalmars-d-learn

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@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\"'"


Re: Can't get dub dustmite to work

2020-04-26 Thread aliak via Digitalmars-d-learn

On Saturday, 25 April 2020 at 18:52:45 UTC, Andre Pany wrote:


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


I'm sorry I didn't follow.

You mean like:

"dub test"

??

I dont pass anything to the -b or -c flag if that's what you mean?



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.


Yeah, that's a good tip. This output is because of a static 
assert in the sumtype library.




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





Re: Can't get dub dustmite to work

2020-04-26 Thread Andre Pany via Digitalmars-d-learn

On Sunday, 26 April 2020 at 22:07:56 UTC, aliak wrote:

On Saturday, 25 April 2020 at 18:52:45 UTC, Andre Pany wrote:


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


I'm sorry I didn't follow.

You mean like:

"dub test"

??

I dont pass anything to the -b or -c flag if that's what you 
mean?




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.


Yeah, that's a good tip. This output is because of a static 
assert in the sumtype library.




Yes, that was my question. `dub test` will use configuration 
`unittest`,
therefore you have to pass the configuration `unittest` to `dub 
dustmite` too.


Kind regards
André


Re: Can't get dub dustmite to work

2020-04-27 Thread Aliak via Digitalmars-d-learn

On Monday, 27 April 2020 at 06:23:08 UTC, Andre Pany wrote:

On Sunday, 26 April 2020 at 22:07:56 UTC, aliak wrote:

On Saturday, 25 April 2020 at 18:52:45 UTC, Andre Pany wrote:

[...]


I'm sorry I didn't follow.

You mean like:

"dub test"

??

I dont pass anything to the -b or -c flag if that's what you 
mean?



[...]


Yeah, that's a good tip. This output is because of a static 
assert in the sumtype library.




Yes, that was my question. `dub test` will use configuration 
`unittest`,
therefore you have to pass the configuration `unittest` to `dub 
dustmite` too.


Kind regards
André


Ah ok. Yes I was passing the unittest confit to dub dustmite.


Re: Can't get dub dustmite to work

2020-04-27 Thread Andre Pany via Digitalmars-d-learn

On Monday, 27 April 2020 at 07:06:03 UTC, Aliak wrote:

On Monday, 27 April 2020 at 06:23:08 UTC, Andre Pany wrote:

On Sunday, 26 April 2020 at 22:07:56 UTC, aliak wrote:

On Saturday, 25 April 2020 at 18:52:45 UTC, Andre Pany wrote:

[...]


I'm sorry I didn't follow.

You mean like:

"dub test"

??

I dont pass anything to the -b or -c flag if that's what you 
mean?



[...]


Yeah, that's a good tip. This output is because of a static 
assert in the sumtype library.




Yes, that was my question. `dub test` will use configuration 
`unittest`,
therefore you have to pass the configuration `unittest` to 
`dub dustmite` too.


Kind regards
André


Ah ok. Yes I was passing the unittest confit to dub dustmite.


In the logs above I can see you pass only  the build type but not 
the configuration (just to make you aware, there is a difference).


Kind regards
Andre


Re: Can't get dub dustmite to work

2020-04-27 Thread Anonymouse via Digitalmars-d-learn

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@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.