Differences From Artifact [10cb7d4bca]:
- File tests/TestsAppDelegate.m — part of check-in [65d5a8f675] at 2013-09-15 21:22:38 on branch trunk — Fix a few format string length modifiers. (user: js, size: 7244) [annotate] [blame] [check-ins using]
To Artifact [07d41aeb0a]:
- File
tests/TestsAppDelegate.m
— part of check-in
[1b6f73dc3a]
at
2013-09-29 20:24:26
on branch trunk
— Add simple non-colored output to tests.
This is used by Xcode now as Xcode's output window does not support
color codes. (user: js, size: 7624) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | case YELLOW: [of_stdout writeString: @"\r\033[K\033[33;1m"]; break; } [of_stdout writeString: str]; [of_stdout writeString: @"\033[m"]; #else # error No output method! #endif } - (void)outputTesting: (OFString*)test inModule: (OFString*)module { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; [self outputString: [OFString stringWithFormat: @"[%@] %@: testing...", module, test] inColor: YELLOW]; [pool release]; } - (void)outputSuccess: (OFString*)test inModule: (OFString*)module { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; [self outputString: [OFString stringWithFormat: @"[%@] %@: ok\n", module, test] inColor: GREEN]; [pool release]; } - (void)outputFailure: (OFString*)test inModule: (OFString*)module { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; [self outputString: [OFString stringWithFormat: @"[%@] %@: failed\n", module, test] inColor: RED]; [pool release]; | > > > > > > > > > > > > > > | | | > > > > | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | case YELLOW: [of_stdout writeString: @"\r\033[K\033[33;1m"]; break; } [of_stdout writeString: str]; [of_stdout writeString: @"\033[m"]; #elif defined(STDOUT_SIMPLE) [of_stdout writeString: str]; #else # error No output method! #endif } - (void)outputTesting: (OFString*)test inModule: (OFString*)module { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; #ifndef STDOUT_SIMPLE [self outputString: [OFString stringWithFormat: @"[%@] %@: testing...", module, test] inColor: YELLOW]; #else [self outputString: [OFString stringWithFormat: @"[%@] %@: ", module, test] inColor: YELLOW]; #endif [pool release]; } - (void)outputSuccess: (OFString*)test inModule: (OFString*)module { #ifndef STDOUT_SIMPLE OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; [self outputString: [OFString stringWithFormat: @"[%@] %@: ok\n", module, test] inColor: GREEN]; [pool release]; #else [self outputString: @"ok\n" inColor: GREEN]; #endif } - (void)outputFailure: (OFString*)test inModule: (OFString*)module { #ifndef STDOUT_SIMPLE OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; [self outputString: [OFString stringWithFormat: @"[%@] %@: failed\n", module, test] inColor: RED]; [pool release]; # ifdef __wii__ [self outputString: @"Press A to continue!\n" inColor: NO_COLOR]; for (;;) { WPAD_ScanPads(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_A) return; VIDEO_WaitVSync(); } # endif # ifdef _PSP [self outputString: @"Press X to continue!\n" inColor: NO_COLOR]; for (;;) { SceCtrlData pad; sceCtrlReadBufferPositive(&pad, 1); if (pad.Buttons & PSP_CTRL_CROSS) { for (;;) { sceCtrlReadBufferPositive(&pad, 1); if (!(pad.Buttons & PSP_CTRL_CROSS)) return; } } } # endif #else [self outputString: @"failed\n" inColor: RED]; #endif } - (void)applicationDidFinishLaunching { #ifdef __wii__ [OFFile changeCurrentDirectoryPath: @"/apps/objfw-tests"]; |
︙ | ︙ |