- Timestamp:
- 03/06/09 13:15:28 (3 years ago)
- Files:
-
- 1 modified
-
trunk/mgunit/src/mgutclirunner__define.pro (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/mgunit/src/mgutclirunner__define.pro
r17 r29 3 3 ;+ 4 4 ; Results for tests, test cases, and test suites are reported to the test 5 ; runner. The MG testCliRunner displays the results in the output log or in a5 ; runner. The MGutCliRunner displays the results in the output log or in a 6 6 ; log file. 7 7 ;- … … 47 47 ; :Keywords: 48 48 ; npass : in, required, type=integer 49 ; number of passing tests contained in the hierarchy below the test50 ; suite49 ; number of passing tests contained in the hierarchy below the test 50 ; suite 51 51 ; nfail : in, required, type=integer 52 52 ; number of failing tests contained in the hierarchy below the test … … 144 144 145 145 if (passed) then begin 146 printf, self.logLun, 'passed'146 self->_print, self.logLun, 'passed', /green 147 147 endif else begin 148 printf, self.logLun, 'failed' + (msg eq '' ? '' : ' "' + msg + '"')148 self->_print, self.logLun, 'failed' + (msg eq '' ? '' : ' "' + msg + '"'), /red 149 149 endelse 150 end 151 152 153 ;+ 154 ; Prints a message to a LUN. 155 ; 156 ; :Params: 157 ; lun : in, required, type=long 158 ; logical unit number to print to 159 ; text : in, required, type=string 160 ; text to print 161 ; 162 ; :Keywords: 163 ; _extra : in, optional, type=keywords 164 ; keywords to MG_ANSICODE i.e. RED or GREEN 165 ;- 166 pro mgutclirunner::_print, lun, text, _extra=e 167 compile_opt strictarr 168 169 if (self.isTty) then begin 170 printf, lun, mg_ansicode(text, _extra=e) 171 endif else begin 172 printf, lun, text 173 endelse 174 end 175 176 177 ;+ 178 ; Safe method of determining if the current terminal is TTY. 179 ; 180 ; :Returns: 181 ; 1 if the terminal is TTY, 0 if not 182 ;- 183 function mgutclirunner::_findIfTty 184 compile_opt strictarr 185 186 catch, error 187 if (error ne 0L) then begin 188 catch, /cancel 189 return, 0 190 endif 191 192 return, mg_termIsTty() 150 193 end 151 194 … … 193 236 self.indent = 3L 194 237 self.space = (byte(' '))[0] 195 238 self.isTty = self->_findIfTty() 239 196 240 !quiet = 1 197 241 return, 1B … … 216 260 logLun : 0L, $ 217 261 indent : 0L, $ 218 space : 0B $ 262 space : 0B, $ 263 isTty: 0B $ 219 264 } 220 265 end
