From: Igor Kulaychuk Date: Mon, 28 Jan 2019 08:49:10 +0000 (+0300) Subject: Add line number to test output about expected line X-Git-Tag: submit/tizen/20190813.035844~18^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5486d483e9ee1275ae59ab91242b866ed268014d;p=sdk%2Ftools%2Fnetcoredbg.git Add line number to test output about expected line --- diff --git a/tests/runner/Runner.cs b/tests/runner/Runner.cs index 82b615b..841c40c 100644 --- a/tests/runner/Runner.cs +++ b/tests/runner/Runner.cs @@ -125,7 +125,7 @@ namespace Runner return queue.ReceiveAsync().Result; } - public MICore.Results Expect(string text, int timeoutSec) + public MICore.Results Expect(string text, int timeoutSec, int line) { if (timeoutSec < 0) timeoutSec = defaultTimeoutSec; @@ -164,7 +164,7 @@ namespace Runner { ts.Dispose(); } - throw new Exception($"Expected '{text}' in {timeSpan}"); + throw new Exception($"Expected '{text}' (at line {line}) in {timeSpan}"); } public void Send(string s) @@ -201,7 +201,7 @@ namespace Runner public int GetCurrentLine([CallerLineNumber] int line = 0) { return line; } public void Send(string s) => processInfo.Send(s); - public MICore.Results Expect(string s, int timeoutSec = -1) => processInfo.Expect(s, timeoutSec); + public MICore.Results Expect(string s, int timeoutSec = -1, [CallerLineNumber] int line = 0) => processInfo.Expect(s, timeoutSec, line); public readonly string TestSource; public readonly string TestBin; public readonly int DefaultExpectTimeout;