Index: generators/TableGenerator.m ================================================================== --- generators/TableGenerator.m +++ generators/TableGenerator.m @@ -9,11 +9,10 @@ * the packaging of this file. */ #include "config.h" -#include #include #import "OFString.h" #import "OFArray.h" #import "OFFile.h" @@ -62,11 +61,11 @@ splitted = [line componentsSeparatedByString: @";"]; if ([splitted count] != 15) { [of_stderr writeFormat: @"Invalid line: %s\n", [line cString]]; - exit(1); + [OFApplication terminateWithStatus: 1]; } splitted_carray = [splitted cArray]; codep = [splitted_carray[0] hexadecimalValueAsInteger]; upper[codep] = [splitted_carray[12] hexadecimalValueAsInteger]; @@ -96,11 +95,11 @@ splitted = [line componentsSeparatedByString: @"; "]; if ([splitted count] != 4) { [of_stderr writeFormat: @"Invalid line: %s\n", [line cString]]; - exit(1); + [OFApplication terminateWithStatus: 1]; } splitted_carray = [splitted cArray]; if (![splitted_carray[1] isEqual: @"S"] && ![splitted_carray[1] isEqual: @"C"]) Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -66,10 +66,17 @@ /** * Terminates the application. */ + (void)terminate; +/** + * Terminates the application with the specified status. + * + * \param status The status with which the application will terminate + */ ++ (void)terminateWithStatus: (int)status; + /** * Sets argc and argv. * * You should not call this directly! Use of_application_main instead! * @@ -108,11 +115,18 @@ /** * Terminates the application. */ - (void)terminate; + +/** + * Terminates the application with the specified status. + * + * \param status The status with which the application will terminate + */ +- (void)terminateWithStatus: (int)status; @end @interface OFObject (OFApplicationDelegate) @end extern int of_application_main(int, char*[], Class); Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -71,10 +71,15 @@ + (void)terminate { exit(0); } + ++ (void)terminateWithStatus: (int)status +{ + exit(status); +} - init { self = [super init]; @@ -136,10 +141,15 @@ - (void)terminate { exit(0); } + +- (void)terminateWithStatus: (int)status +{ + exit(status); +} - (void)dealloc { [arguments release]; [delegate release]; Index: tests/TestsAppDelegate.m ================================================================== --- tests/TestsAppDelegate.m +++ tests/TestsAppDelegate.m @@ -95,7 +95,10 @@ [self pluginTests]; #endif #ifdef OF_HAVE_PROPERTIES [self propertiesTests]; #endif + + if (fails > 0) + [OFApplication terminateWithStatus: fails]; } @end