ObjFW  Check-in [1b6f73dc3a]

Overview
Comment:Add simple non-colored output to tests.

This is used by Xcode now as Xcode's output window does not support
color codes.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1b6f73dc3a1b6e883508c430b8b36639c69e89556f2f2a8eb10284b70eca6f3a
User & Date: js on 2013-09-29 20:24:26
Other Links: manifest | tags
Context
2013-09-30
16:01
OFHTTPClient: Improve 3xx status handling. check-in: 2c075194b3 user: js tags: trunk
2013-09-29
20:24
Add simple non-colored output to tests. check-in: 1b6f73dc3a user: js tags: trunk
19:44
Get rid of a warning on 32-bit systems with Clang. check-in: 90de201b43 user: js tags: trunk
Changes

Modified ObjFW.xcodeproj/project.pbxproj from [61c2b0f765] to [ad12d4c2b2].

2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
				PRODUCT_NAME = ObjFW;
			};
			name = Release;
		};
		4BF33AF7133807310059CEF7 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				GCC_PREPROCESSOR_DEFINITIONS = STDOUT;
				INSTALL_PATH = "";
				PRODUCT_NAME = "$(TARGET_NAME)";
			};
			name = Debug;
		};
		4BF33AF8133807310059CEF7 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				GCC_PREPROCESSOR_DEFINITIONS = STDOUT;
				INSTALL_PATH = "";
				PRODUCT_NAME = "$(TARGET_NAME)";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */








|








|







2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
				PRODUCT_NAME = ObjFW;
			};
			name = Release;
		};
		4BF33AF7133807310059CEF7 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				GCC_PREPROCESSOR_DEFINITIONS = STDOUT_SIMPLE;
				INSTALL_PATH = "";
				PRODUCT_NAME = "$(TARGET_NAME)";
			};
			name = Debug;
		};
		4BF33AF8133807310059CEF7 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				GCC_PREPROCESSOR_DEFINITIONS = STDOUT_SIMPLE;
				INSTALL_PATH = "";
				PRODUCT_NAME = "$(TARGET_NAME)";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

Modified tests/TestsAppDelegate.m from [10cb7d4bca] to [07d41aeb0a].

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
	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];

#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
}

- (void)applicationDidFinishLaunching
{
#ifdef __wii__
	[OFFile changeCurrentDirectoryPath: @"/apps/objfw-tests"];







>
>









>



>
>
>
>
>






>





>
>
>
>





>






|










|
|














>
>
>
>







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"];