@@ -69,15 +69,27 @@ function! s:Paint() abort
69
69
let tests = job.tests[testproject][testfile]
70
70
for name in sort (keys (tests), {a ,b - > tests[a ].lnum > tests[b ].lnum})
71
71
let test = tests[name]
72
- let state = s: utils .state2char[test.state ]
72
+ let state = s: utils .state2char[test.state ]
73
73
call add (lines , printf (' %s %s' , state , name))
74
74
if state == # ' -' && ! has_key (test, ' spintimer' )
75
75
call s: spinner .start (test, len (lines ))
76
76
endif
77
+ let message = get (test, ' message' , [])
78
+ if len (message)
79
+ for messageline in message
80
+ call add (lines , ' > ' . trim (messageline, ' ' , 2 ))
81
+ endfor
82
+ endif
83
+ let stacktrace = get (test, ' stacktrace' , [])
84
+ if len (stacktrace)
85
+ for stacktraceline in stacktrace
86
+ call add (lines , ' > ' . trim (stacktraceline, ' ' , 2 ))
87
+ endfor
88
+ endif
77
89
let output = get (test, ' output' , [])
78
90
if len (output)
79
91
for outputline in output
80
- call add (lines , ' // ' . outputline)
92
+ call add (lines , ' // ' . trim ( outputline, ' ' , 2 ) )
81
93
endfor
82
94
endif
83
95
endfor
@@ -122,14 +134,19 @@ function! OmniSharp#testrunner#SetTests(bufferTests) abort
122
134
call win_gotoid (winid)
123
135
endfunction
124
136
125
- function ! s: UpdateState (bufnr , testnames, state , output) abort
137
+ function ! s: UpdateState (bufnr , testnames, state , ... ) abort
138
+ let message = a: 0 ? a: 1 : []
139
+ let stacktrace = a: 0 > 1 ? a: 2 : []
140
+ let output = a: 0 > 2 ? a: 3 : []
126
141
let projectname = s: utils .getProjectName (a: bufnr )
127
142
let filename = fnamemodify (bufname (a: bufnr ), ' :p' )
128
143
let tests = OmniSharp#GetHost (a: bufnr ).job.tests[projectname][filename]
129
144
for testname in a: testnames
130
145
if has_key (tests, testname)
131
146
let tests[testname].state = a: state
132
- let tests[testname].output = a: output
147
+ let tests[testname].message = message
148
+ let tests[testname].stacktrace = stacktrace
149
+ let tests[testname].output = output
133
150
endif
134
151
endfor
135
152
call s: Repaint ()
@@ -138,7 +155,7 @@ endfunction
138
155
function ! OmniSharp#testrunner#StateRunning (bufnr , testnames) abort
139
156
let testnames = type (a: testnames ) == type ([]) ? a: testnames : [a: testnames ]
140
157
let s: lasttestnames = testnames
141
- call s: UpdateState (a: bufnr , testnames, ' Running' , [] )
158
+ call s: UpdateState (a: bufnr , testnames, ' Running' )
142
159
endfunction
143
160
144
161
function ! OmniSharp#testrunner#StateComplete (location) abort
@@ -149,12 +166,14 @@ function! OmniSharp#testrunner#StateComplete(location) abort
149
166
else
150
167
let state = ' Passed'
151
168
endif
152
- let output = get (a: location , ' output' , [])
153
- call s: UpdateState (a: .location.bufnr , [a: location .fullname], state , output)
169
+ call s: UpdateState (a: .location.bufnr , [a: location .fullname], state ,
170
+ \ get (a: location , ' message' , []),
171
+ \ get (a: location , ' stacktrace' , []),
172
+ \ get (a: location , ' output' , []))
154
173
endfunction
155
174
156
175
function ! OmniSharp#testrunner#StateSkipped (bufnr ) abort
157
- call s: UpdateState (a: bufnr , s: lasttestnames , ' Not run' , [] )
176
+ call s: UpdateState (a: bufnr , s: lasttestnames , ' Not run' )
158
177
endfunction
159
178
160
179
0 commit comments