www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Trying to use Dustmite

reply =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
I'm trying to figure out how to use DustMite.

I have a file `tester.d` in a clean sub-directory `src` containing


void err(int x)
{
     assert(x > 0);
}

auto inc(int x)
{
     return x + 1;
}

void main(string[] args)
{
     auto y = inc(42);
     err(10);
     err(-10);
}


I want to reduce with respect to AssertError thrown in the 
function `err`. BUt when I call

     dustmite src 'dmd tester && ./tester | grep -qF "Assertion 
failure"'

I doesn't progress but instead I get

Loading src/tester.d
None => No
object.Exception dustmite.d(270): Initial test fails (try using 
--no-redirect for details)
----------------
??:? _Dmain [0x5c6be8]
??:? 
_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv 
[0x62544e]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate()) [0x625398]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).runAll() [0x62540a]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate()) [0x625398]
??:? _d_run_main [0x625309]
??:? main [0x61732d]
??:? __libc_start_main [0xb429f82f]

What am doing wrong?
Oct 19 2016
next sibling parent =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Wednesday, 19 October 2016 at 08:50:47 UTC, Nordlöw wrote:
 object.Exception dustmite.d(270): Initial test fails (try using 
 --no-redirect for details)
When I add the flag --no-redirect to DMD I instead get Loading src/tester.d None => core.exception.AssertError tester.d(3): Assertion failure ---------------- ??:? _d_assert [0x4276bb] ??:? void tester.__assert(int) [0x4275ec] ??:? void tester.err(int) [0x427562] ??:? _Dmain [0x427599] ??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x427b32] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x427a7c] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x427aee] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x427a7c] ??:? _d_run_main [0x4279ed] ??:? main [0x427625] ??:? __libc_start_main [0xa71282f] No object.Exception dustmite.d(270): Initial test fails ---------------- ??:? _Dmain [0x5c6be8] ??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x62544e] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x625398] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x62540a] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x625398] ??:? _d_run_main [0x625309] ??:? main [0x61732d] ??:? __libc_start_main [0xbe15382f] Which doesn't seem to be what I want, right?
Oct 19 2016
prev sibling parent =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Wednesday, 19 October 2016 at 08:50:47 UTC, Nordlöw wrote:
 I want to reduce with respect to AssertError thrown in the 
 function `err`. BUt when I call

     dustmite src 'dmd tester && ./tester | grep -qF "Assertion 
 failure"'
Found it. Shall be: dustmite src 'dmd tester && ./tester 2>&1 | grep -qF "Assertion failure"'
Oct 19 2016