--- a/Tests/GNUmakefile +++ b/Tests/GNUmakefile @@ -42,11 +42,29 @@ include $(GNUSTEP_MAKEFILES)/common.make +TOP_DIR := $(shell dirname $(CURDIR)) + all:: @(echo If you want to run the gnustep-gui testsuite, please type \'make check\') check:: - gnustep-tests gui + (\ + GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES="$(TOP_DIR)/gui.make";\ + ADDITIONAL_INCLUDE_DIRS="-I$(TOP_DIR)/Headers -I$(TOP_DIR)/Source/$(GNUSTEP_TARGET_DIR) -I$(TOP_DIR)/Headers/Additions";\ + ADDITIONAL_LIB_DIRS="-L$(TOP_DIR)/Source/$(GNUSTEP_OBJ_DIR)";\ + LD_LIBRARY_PATH="$(TOP_DIR)/Source/$(GNUSTEP_OBJ_DIR):${LD_LIBRARY_PATH}";\ + PATH="$(TOP_DIR)/Tools/$(GNUSTEP_OBJ_DIR):${PATH}";\ + export GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES;\ + export ADDITIONAL_INCLUDE_DIRS;\ + export ADDITIONAL_LIB_DIRS;\ + export LD_LIBRARY_PATH;\ + export PATH;\ + if [ "$(DEBUG)" = "" ]; then \ + gnustep-tests gui;\ + else \ + gnustep-tests --debug gui;\ + fi; \ + ) clean:: -gnustep-tests --clean --- a/Tests/gui/NSCell/basic.m +++ b/Tests/gui/NSCell/basic.m @@ -13,7 +13,18 @@ id testObject2; NSArray *testObjects; - [NSApplication sharedApplication]; + START_SET("NSCell GNUstep basic") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER test_alloc(@"NSCell"); @@ -29,6 +40,7 @@ @"NSCell", testObjects, NO, NO); + END_SET("NSCell GNUstep basic") [arp release]; return 0; } @@ -57,4 +69,4 @@ return YES; } -@end +@end \ No newline at end of file --- a/Tests/gui/NSCell/objectValue.m +++ b/Tests/gui/NSCell/objectValue.m @@ -12,8 +12,19 @@ CREATE_AUTORELEASE_POOL(arp); NSCell *cell; NSNumber *num; + + START_SET("NSCell GNUstep objectValue") - [NSApplication sharedApplication]; + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER cell = [[NSCell alloc] init]; num = [NSNumber numberWithFloat:55.0]; [cell setObjectValue:num]; @@ -31,6 +42,8 @@ pass ([[cell objectValue] isEqual:[NSImage imageNamed:@"GNUstep"]], "-objectValue with NSImage works"); + END_SET("NSCell GNUstep objectValue") + DESTROY(arp); return 0; } --- a/Tests/gui/NSView/NSView_autoresize_and_rounding.m +++ b/Tests/gui/NSView/NSView_autoresize_and_rounding.m @@ -49,7 +49,19 @@ NSView *view1; int passed = 1; - [NSApplication sharedApplication]; + START_SET("NSView GNUstep autoresize_and_rounding") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,100,100) styleMask: NSBorderlessWindowMask backing: NSBackingStoreRetained @@ -225,6 +237,8 @@ [view2 release]; } + END_SET("NSView GNUstep autoresize_and_rounding") + DESTROY(arp); return 0; -} +} \ No newline at end of file --- a/Tests/gui/NSView/NSView_bounds_scale.m +++ b/Tests/gui/NSView/NSView_bounds_scale.m @@ -93,8 +93,20 @@ NSView *view1; CGFloat ts[6]; int passed = 1; - - [NSApplication sharedApplication]; + + START_SET("NView GNUstep bounds_scale") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200) styleMask: NSClosableWindowMask backing: NSBackingStoreRetained @@ -189,6 +201,8 @@ pass(passed,"NSView -scaleUnitSquareToSize works"); testHopeful = NO; + END_SET("NView GNUstep bounds_scale") + DESTROY(arp); return 0; } --- a/Tests/gui/NSView/NSView_convertRect.m +++ b/Tests/gui/NSView/NSView_convertRect.m @@ -97,7 +97,19 @@ NSView *view1,*view2; int passed=1; - [NSApplication sharedApplication]; + START_SET("NView GNUstep converRect") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + window=[[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200) styleMask: NSClosableWindowMask backing: NSBackingStoreRetained @@ -130,6 +142,8 @@ pass(passed,"NSView -convertRect:fromView: and -convertRect:toView: work"); + END_SET("NView GNUstep converRect") + DESTROY(arp); return 0; } --- a/Tests/gui/NSView/NSView_frame_bounds.m +++ b/Tests/gui/NSView/NSView_frame_bounds.m @@ -54,7 +54,19 @@ NSView *view1; int passed = 1; - [NSApplication sharedApplication]; + START_SET("NView GNUstep frame_bounds") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200) styleMask: NSClosableWindowMask backing: NSBackingStoreRetained @@ -110,6 +122,8 @@ pass(passed,"NSView -frame and -bounds work"); + END_SET("NView GNUstep frame_bounds") + DESTROY(arp); return 0; } --- a/Tests/gui/NSView/NSView_frame_rotation.m +++ b/Tests/gui/NSView/NSView_frame_rotation.m @@ -18,7 +18,19 @@ NSView *view; int passed; - [NSApplication sharedApplication]; + START_SET("NView GNUstep frame_rotation") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + window=[[NSWindow alloc] init]; view=[[NSView alloc] init]; @@ -54,6 +66,8 @@ pass(passed,"-frameRotation/-setFrameRotation work"); + END_SET("NView GNUstep frame_rotation") + DESTROY(arp); return 0; } --- a/Tests/gui/TextSystem/deallocation.m +++ b/Tests/gui/TextSystem/deallocation.m @@ -25,8 +25,19 @@ NSTextView *tv; CREATE_AUTORELEASE_POOL(arp); - // Create shared application object (required by NSTextView) - [NSApplication sharedApplication]; + START_SET("TextSystem GNUstep deallocation") + + NS_DURING + { + // Create shared application object (required by NSTextView) + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER // Set up text network retaining all elements ts = [NSTextStorage new]; @@ -70,6 +81,8 @@ pass([tv layoutManager] == nil, "NSTextView -layoutManager returns nil"); pass([tv textStorage] == nil, "NSTextView -textStorage returns nil"); + END_SET("TextSystem GNUstep deallocation") + DESTROY(arp); return 0; } --- a/Tests/gui/TextSystem/repeatedAttachmentCellHeight.m +++ b/Tests/gui/TextSystem/repeatedAttachmentCellHeight.m @@ -5,6 +5,8 @@ the entire height of a line frag. */ +#include "Testing.h" + #include #include #include @@ -42,7 +44,18 @@ NSTextContainer *tc; NSTextAttachment *ta; - [NSApplication sharedApplication]; + START_SET("TextSystem GNUstep repeatedAttachmentCellHeight"); + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed"); + } + NS_ENDHANDLER text=[[NSTextStorage alloc] init]; lm=[[NSLayoutManager alloc] init]; @@ -63,6 +76,8 @@ [text endEditing]; [lm usedRectForTextContainer: tc]; + END_SET("TextSystem GNUstep repeatedAttachmentCellHeight"); + DESTROY(arp); return 0; } --- a/Tests/gui/NSView/scrollRectToVisible.m +++ b/Tests/gui/NSView/scrollRectToVisible.m @@ -29,7 +29,20 @@ NSClipView *cv=[[NSClipView alloc] initWithFrame: NSMakeRect(0,0,10,10)]; NSView *v=[[NSView alloc] initWithFrame: NSMakeRect(0,0,100,100)]; [cv setDocumentView: v]; - [NSApplication sharedApplication]; + + START_SET("NView GNUstep scrollRectToVisible") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200) styleMask: NSClosableWindowMask backing: NSBackingStoreRetained @@ -84,8 +97,9 @@ [v scrollRectToVisible: NSMakeRect(15,15,5,5)]; TEST(NSMakeRect(10,10,10,10),"12"); + END_SET("NView GNUstep scrollRectToVisible") + DESTROY(arp); return 0; } - --- a/Tests/gui/NSEvent/delta.m +++ b/Tests/gui/NSEvent/delta.m @@ -11,7 +11,19 @@ CREATE_AUTORELEASE_POOL(arp); NSEvent *ev; - [NSApplication sharedApplication]; + START_SET("NSEvent GNUstep delta") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + ev = [NSEvent mouseEventWithType: NSLeftMouseDown location: NSMakePoint(0.0, 0.0) modifierFlags: 0 @@ -39,6 +51,8 @@ pass([ev deltaY] == 0.0, "-deltaY with NSKeyDown event works"); pass([ev deltaZ] == 0.0, "-deltaZ with NSKeyDown event works"); + END_SET("NSEvent GNUstep delta") + DESTROY(arp); return 0; } --- a/Tests/gui/NSSliderCell/minMax.m +++ b/Tests/gui/NSSliderCell/minMax.m @@ -12,8 +12,20 @@ CREATE_AUTORELEASE_POOL(arp); NSSliderCell *cell; NSNumber *num; - - [NSApplication sharedApplication]; + + START_SET("NSSliderCell GNUstep minMax") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + cell = [[NSSliderCell alloc] init]; pass([cell isContinuous], "slider continuous by default"); @@ -121,6 +133,7 @@ pass([cell doubleValue] == 9.0, "setting 15 floatValue sets value to max"); pass([cell intValue] == 9, "setting 15 floatValue sets value to max (integer)"); + END_SET("NSSliderCell GNUstep minMax") DESTROY(arp); return 0; --- a/Tests/gui/NSSavePanel/setDelegate_reload.m +++ b/Tests/gui/NSSavePanel/setDelegate_reload.m @@ -44,8 +44,19 @@ NSSavePanel *p; NSMatrix *m; - [NSApplication sharedApplication]; - + START_SET("NSSavePanel GNUstep setDelegate") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER + p = [NSSavePanel savePanel]; [p setShowsHiddenFiles: NO]; [p setDirectory: [[[[[NSBundle mainBundle] bundlePath] @@ -80,7 +91,9 @@ pass([m numberOfRows] == 1 && [[[m cellAtRow: 0 column: 0] stringValue] isEqual: @"A"], "browser is reloaded after -setDelegate: (2)"); - + + END_SET("NSSavePanel GNUstep setDelegate") + [arp release]; return 0; } --- a/Tests/gui/NSPopUpButton/defaultSelection.m +++ b/Tests/gui/NSPopUpButton/defaultSelection.m @@ -12,7 +12,18 @@ CREATE_AUTORELEASE_POOL(arp); NSPopUpButton *b; - [NSApplication sharedApplication]; + START_SET("NSPopupButton GNUstep defaultSelection") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER b=[[NSPopUpButton alloc] init]; @@ -21,6 +32,8 @@ pass([b indexOfSelectedItem] == 0,"first item is selected by default"); + END_SET("NSPopupButton GNUstep defaultSelection") + DESTROY(arp); return 0; --- a/Tests/gui/NSImage/basic.m +++ b/Tests/gui/NSImage/basic.m @@ -12,7 +12,18 @@ id testObject2; NSArray *testObjects; - [NSApplication sharedApplication]; + START_SET("NSImage GNUstep basic") + + NS_DURING + { + [NSApplication sharedApplication]; + } + NS_HANDLER + { + if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) + SKIP("It looks like GNUstep backend is not yet installed") + } + NS_ENDHANDLER test_alloc(@"NSImage"); @@ -30,6 +41,8 @@ @"NSImage", testObjects, NO, NO); + END_SET("NSImage GNUstep basic") + [arp release]; return 0; } --- a/Tests/gui/NSPasteboard/lazy_copy.m +++ b/Tests/gui/NSPasteboard/lazy_copy.m @@ -40,10 +40,13 @@ pb=[NSPasteboard pasteboardWithName: @"lazy copy test"]; s=[pb stringForType: NSStringPboardType]; + testHopeful = YES; pass([s isEqual: theString], "NSPasteboard handles lazy setting of data"); + testHopeful = NO; DESTROY(arp); return 0; } +