Differences From Artifact [949d72dfbf]:
- File
tests/TestsAppDelegate.m
— part of check-in
[2713b481a1]
at
2013-04-27 02:22:43
on branch trunk
— Initial Wii port.
Threads and sockets still missing. (user: js, size: 5629) [annotate] [blame] [check-ins using]
To Artifact [5d7f8b1eec]:
- File tests/TestsAppDelegate.m — part of check-in [daa4869d18] at 2013-04-27 17:57:53 on branch trunk — Wii: Link only tests with libwiiuse and libbte. (user: js, size: 5634) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
83 84 85 86 87 88 89 | } @catch (id e) { TestsAppDelegate *delegate = [[OFApplication sharedApplication] delegate]; OFString *string = [OFString stringWithFormat: @"\nRuntime error: Unhandled exception:\n%@\n", e]; [delegate outputString: string | | | | | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | } @catch (id e) { TestsAppDelegate *delegate = [[OFApplication sharedApplication] delegate]; OFString *string = [OFString stringWithFormat: @"\nRuntime error: Unhandled exception:\n%@\n", e]; [delegate outputString: string inColor: RED]; [delegate outputString: @"Press home button to exit!\n" inColor: NO_COLOR]; for (;;) { WPAD_ScanPads(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) [OFApplication terminateWithStatus: 1]; VIDEO_WaitVSync(); } } #else return of_application_main(&argc, &argv, [TestsAppDelegate class]); #endif } @implementation TestsAppDelegate - (void)outputString: (OFString*)str inColor: (int)color { #if defined(_PSP) char i, space = ' '; int y = pspDebugScreenGetY(); pspDebugScreenSetXY(0, y); for (i = 0; i < 68; i++) |
︙ | ︙ | |||
158 159 160 161 162 163 164 | - (void)outputTesting: (OFString*)test inModule: (OFString*)module { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; [self outputString: [OFString stringWithFormat: @"[%@] %@: testing...", module, test] | | | | | | | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | - (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]; #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 } - (void)applicationDidFinishLaunching { #ifdef _PSP pspDebugScreenInit(); #endif #ifdef __wii__ [OFFile changeToDirectoryAtPath: @"/apps/objfw-tests"]; #endif [self objectTests]; #ifdef OF_HAVE_BLOCKS [self blockTests]; #endif [self MD5HashTests]; |
︙ | ︙ | |||
244 245 246 247 248 249 250 | [self forwardingTests]; #ifdef OF_HAVE_PROPERTIES [self propertiesTests]; #endif #ifdef __wii__ [self outputString: @"Press home button to exit!\n" | | | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | [self forwardingTests]; #ifdef OF_HAVE_PROPERTIES [self propertiesTests]; #endif #ifdef __wii__ [self outputString: @"Press home button to exit!\n" inColor: NO_COLOR]; for (;;) { WPAD_ScanPads(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) [OFApplication terminateWithStatus: _fails]; VIDEO_WaitVSync(); } #else [OFApplication terminateWithStatus: _fails]; #endif } @end |