ObjFW  Check-in [f82e6faffc]

Overview
Comment:ObjFWTest: Don't use \r if terminal is present

This should work better for platforms that don't have an ANSI terminal.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f82e6faffc18dfcec75b1a24116aaa6222c490c81710f7a81f56151e80e04355
User & Date: js on 2024-02-18 22:58:27
Other Links: manifest | tags
Context
2024-02-18
23:40
ObjFWTest: Allow specifying test cases to run check-in: ed304d67c9 user: js tags: trunk
22:58
ObjFWTest: Don't use \r if terminal is present check-in: f82e6faffc user: js tags: trunk
22:03
Use __mingw_aligned_* instead of _aligned_* check-in: 7965aac7d5 user: js tags: trunk
Changes

Modified src/test/OTAppDelegate.m from [e5ebae8f3e] to [a06b09228a].

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
			[OFStdOut writeString: @"]: "];
		} else
			[OFStdOut writeFormat: @"-[%@ %s]: ",
					       class, sel_getName(test)];
		break;
	case StatusOk:
		if (OFStdOut.hasTerminal) {


			[OFStdOut setForegroundColor: [OFColor green]];
			[OFStdOut writeFormat: @"\r-[%@ ", class];
			[OFStdOut setForegroundColor: [OFColor lime]];
			[OFStdOut writeFormat: @"%s", sel_getName(test)];
			[OFStdOut setForegroundColor: [OFColor green]];
			[OFStdOut writeLine: @"]: ok"];
		} else
			[OFStdOut writeLine: @"ok"];
		break;
	case StatusFailed:
		if (OFStdOut.hasTerminal) {


			[OFStdOut setForegroundColor: [OFColor maroon]];
			[OFStdOut writeFormat: @"\r-[%@ ", class];
			[OFStdOut setForegroundColor: [OFColor red]];
			[OFStdOut writeFormat: @"%s", sel_getName(test)];
			[OFStdOut setForegroundColor: [OFColor maroon]];
			[OFStdOut writeLine: @"]: failed"];
			[OFStdOut writeLine: description];
		} else
			[OFStdOut writeLine: @"failed"];
		break;
	case StatusSkipped:
		if (OFStdOut.hasTerminal) {


			[OFStdOut setForegroundColor: [OFColor gray]];
			[OFStdOut writeFormat: @"\r-[%@ ", class];
			[OFStdOut setForegroundColor: [OFColor silver]];
			[OFStdOut writeFormat: @"%s", sel_getName(test)];
			[OFStdOut setForegroundColor: [OFColor gray]];
			[OFStdOut writeLine: @"]: skipped"];
		} else
			[OFStdOut writeLine: @"skipped"];








>
>

|









>
>

|










>
>

|







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
			[OFStdOut writeString: @"]: "];
		} else
			[OFStdOut writeFormat: @"-[%@ %s]: ",
					       class, sel_getName(test)];
		break;
	case StatusOk:
		if (OFStdOut.hasTerminal) {
			[OFStdOut setCursorColumn: 0];
			[OFStdOut eraseLine];
			[OFStdOut setForegroundColor: [OFColor green]];
			[OFStdOut writeFormat: @"-[%@ ", class];
			[OFStdOut setForegroundColor: [OFColor lime]];
			[OFStdOut writeFormat: @"%s", sel_getName(test)];
			[OFStdOut setForegroundColor: [OFColor green]];
			[OFStdOut writeLine: @"]: ok"];
		} else
			[OFStdOut writeLine: @"ok"];
		break;
	case StatusFailed:
		if (OFStdOut.hasTerminal) {
			[OFStdOut setCursorColumn: 0];
			[OFStdOut eraseLine];
			[OFStdOut setForegroundColor: [OFColor maroon]];
			[OFStdOut writeFormat: @"-[%@ ", class];
			[OFStdOut setForegroundColor: [OFColor red]];
			[OFStdOut writeFormat: @"%s", sel_getName(test)];
			[OFStdOut setForegroundColor: [OFColor maroon]];
			[OFStdOut writeLine: @"]: failed"];
			[OFStdOut writeLine: description];
		} else
			[OFStdOut writeLine: @"failed"];
		break;
	case StatusSkipped:
		if (OFStdOut.hasTerminal) {
			[OFStdOut setCursorColumn: 0];
			[OFStdOut eraseLine];
			[OFStdOut setForegroundColor: [OFColor gray]];
			[OFStdOut writeFormat: @"-[%@ ", class];
			[OFStdOut setForegroundColor: [OFColor silver]];
			[OFStdOut writeFormat: @"%s", sel_getName(test)];
			[OFStdOut setForegroundColor: [OFColor gray]];
			[OFStdOut writeLine: @"]: skipped"];
		} else
			[OFStdOut writeLine: @"skipped"];