diff --git a/ChangeLog b/ChangeLog index 350ab8eb1..dc7ed043e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2016-05-13 Eric Heintzmann + + * Tests/GNUmakefile: + * Tests/gui/NSCell/basic.m: + * Tests/gui/NSCell/objectValue.m: + * Tests/gui/NSEvent/delta.m: + * Tests/gui/NSImage/basic.m: + * Tests/gui/NSPasteboard/lazy_copy.m: + * Tests/gui/NSPopUpButton/defaultSelection.m: + * Tests/gui/NSSavePanel/setDelegate_reload.m: + * Tests/gui/NSSliderCell/minMax.m: + * Tests/gui/NSView/NSView_autoresize_and_rounding.m: + * Tests/gui/NSView/NSView_bounds_scale.m: + * Tests/gui/NSView/NSView_convertRect.m: + * Tests/gui/NSView/NSView_frame_bounds.m: + * Tests/gui/NSView/NSView_frame_rotation.m: + * Tests/gui/NSView/scrollRectToVisible.m: + * Tests/gui/TextSystem/deallocation.m: + * Tests/gui/TextSystem/repeatedAttachmentCellHeight.m: + Updates to more cleanly handle attempts to execute regression tests + when the GUI is not installed (test what we can, and report the + problem). + 2016-04-06 Riccardo Mottola * Source/NSWorkspace.m diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 9d03eb258..8d651b20b 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -1030,13 +1030,13 @@ - (CGFloat) menuSubmenuHorizontalOverlap { return [[NSUserDefaults standardUserDefaults] - floatForKey: @"GSMenuSubmenuHorizontalOverlap"]; + floatForKey: @"GSMenuSubmenuHorizontalOverlap"]; } - (CGFloat) menuSubmenuVerticalOverlap { return [[NSUserDefaults standardUserDefaults] - floatForKey: @"GSMenuSubmenuVerticalOverlap"]; + floatForKey: @"GSMenuSubmenuVerticalOverlap"]; } - (void) drawSeparatorItemForMenuItemCell: (NSMenuItemCell *)cell @@ -1044,8 +1044,9 @@ inView: (NSView *)controlView isHorizontal: (BOOL)isHorizontal { - GSDrawTiles *tiles = [self tilesNamed: GSMenuSeparatorItem state: GSThemeNormalState]; + GSDrawTiles *tiles; + tiles = [self tilesNamed: GSMenuSeparatorItem state: GSThemeNormalState]; if (tiles == nil) { NSBezierPath *path = [NSBezierPath bezierPath]; @@ -1053,7 +1054,7 @@ NSPoint start = NSMakePoint(inset, cellFrame.size.height / 2 + cellFrame.origin.y + 0.5); NSPoint end = NSMakePoint(cellFrame.size.width - inset, - cellFrame.size.height / 2 + cellFrame.origin.y + 0.5); + cellFrame.size.height / 2 + cellFrame.origin.y + 0.5); [[self menuSeparatorColor] set]; diff --git a/Tests/GNUmakefile b/Tests/GNUmakefile index 950ee3393..367fbaf03 100644 --- a/Tests/GNUmakefile +++ b/Tests/GNUmakefile @@ -42,11 +42,29 @@ endif 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 diff --git a/Tests/gui/NSCell/basic.m b/Tests/gui/NSCell/basic.m index c557d6a03..5d03c1568 100644 --- a/Tests/gui/NSCell/basic.m +++ b/Tests/gui/NSCell/basic.m @@ -13,7 +13,18 @@ int main() 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 @@ int main() @"NSCell", testObjects, NO, NO); + END_SET("NSCell GNUstep basic") [arp release]; return 0; } @@ -57,4 +69,4 @@ int main() return YES; } -@end +@end \ No newline at end of file diff --git a/Tests/gui/NSCell/objectValue.m b/Tests/gui/NSCell/objectValue.m index 2a43006df..f444c399e 100644 --- a/Tests/gui/NSCell/objectValue.m +++ b/Tests/gui/NSCell/objectValue.m @@ -12,8 +12,19 @@ int main() 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 @@ int main() pass ([[cell objectValue] isEqual:[NSImage imageNamed:@"GNUstep"]], "-objectValue with NSImage works"); + END_SET("NSCell GNUstep objectValue") + DESTROY(arp); return 0; } diff --git a/Tests/gui/NSEvent/delta.m b/Tests/gui/NSEvent/delta.m index c9f569e7c..47c87afd5 100644 --- a/Tests/gui/NSEvent/delta.m +++ b/Tests/gui/NSEvent/delta.m @@ -11,7 +11,19 @@ int main() 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 @@ int main() 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; } diff --git a/Tests/gui/NSImage/basic.m b/Tests/gui/NSImage/basic.m index eb36fd998..9fbfde2ee 100644 --- a/Tests/gui/NSImage/basic.m +++ b/Tests/gui/NSImage/basic.m @@ -12,7 +12,18 @@ int main() 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 @@ int main() @"NSImage", testObjects, NO, NO); + END_SET("NSImage GNUstep basic") + [arp release]; return 0; } diff --git a/Tests/gui/NSPasteboard/lazy_copy.m b/Tests/gui/NSPasteboard/lazy_copy.m index 183451919..02c727a16 100644 --- a/Tests/gui/NSPasteboard/lazy_copy.m +++ b/Tests/gui/NSPasteboard/lazy_copy.m @@ -40,10 +40,13 @@ int main(int argc, char **argv) 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; } + diff --git a/Tests/gui/NSPopUpButton/defaultSelection.m b/Tests/gui/NSPopUpButton/defaultSelection.m index a80545783..7a9b9cd54 100644 --- a/Tests/gui/NSPopUpButton/defaultSelection.m +++ b/Tests/gui/NSPopUpButton/defaultSelection.m @@ -12,7 +12,18 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) pass([b indexOfSelectedItem] == 0,"first item is selected by default"); + END_SET("NSPopupButton GNUstep defaultSelection") + DESTROY(arp); return 0; diff --git a/Tests/gui/NSSavePanel/setDelegate_reload.m b/Tests/gui/NSSavePanel/setDelegate_reload.m index 6cc45b20c..279798e0e 100644 --- a/Tests/gui/NSSavePanel/setDelegate_reload.m +++ b/Tests/gui/NSSavePanel/setDelegate_reload.m @@ -44,8 +44,19 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) 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; } diff --git a/Tests/gui/NSSliderCell/minMax.m b/Tests/gui/NSSliderCell/minMax.m index b125d0d7d..f778ac6bf 100644 --- a/Tests/gui/NSSliderCell/minMax.m +++ b/Tests/gui/NSSliderCell/minMax.m @@ -12,8 +12,20 @@ int main() 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 @@ int main() 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; diff --git a/Tests/gui/NSView/NSView_autoresize_and_rounding.m b/Tests/gui/NSView/NSView_autoresize_and_rounding.m index 5a7277969..27775293c 100755 --- a/Tests/gui/NSView/NSView_autoresize_and_rounding.m +++ b/Tests/gui/NSView/NSView_autoresize_and_rounding.m @@ -56,7 +56,19 @@ int main(int argc, char **argv) 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 @@ -253,6 +265,8 @@ int main(int argc, char **argv) [view2 release]; } + END_SET("NSView GNUstep autoresize_and_rounding") + DESTROY(arp); return 0; -} +} \ No newline at end of file diff --git a/Tests/gui/NSView/NSView_bounds_scale.m b/Tests/gui/NSView/NSView_bounds_scale.m index 37b0fa66d..432da51c7 100644 --- a/Tests/gui/NSView/NSView_bounds_scale.m +++ b/Tests/gui/NSView/NSView_bounds_scale.m @@ -93,8 +93,20 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) pass(passed,"NSView -scaleUnitSquareToSize works"); testHopeful = NO; + END_SET("NView GNUstep bounds_scale") + DESTROY(arp); return 0; } diff --git a/Tests/gui/NSView/NSView_convertRect.m b/Tests/gui/NSView/NSView_convertRect.m index 420ee1dc9..f516ac64f 100644 --- a/Tests/gui/NSView/NSView_convertRect.m +++ b/Tests/gui/NSView/NSView_convertRect.m @@ -97,7 +97,19 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) pass(passed,"NSView -convertRect:fromView: and -convertRect:toView: work"); + END_SET("NView GNUstep converRect") + DESTROY(arp); return 0; } diff --git a/Tests/gui/NSView/NSView_frame_bounds.m b/Tests/gui/NSView/NSView_frame_bounds.m index 7e15fa3ad..819dcde8b 100755 --- a/Tests/gui/NSView/NSView_frame_bounds.m +++ b/Tests/gui/NSView/NSView_frame_bounds.m @@ -54,7 +54,19 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) pass(passed,"NSView -frame and -bounds work"); + END_SET("NView GNUstep frame_bounds") + DESTROY(arp); return 0; } diff --git a/Tests/gui/NSView/NSView_frame_rotation.m b/Tests/gui/NSView/NSView_frame_rotation.m index 2198de36b..8a9b2dc57 100644 --- a/Tests/gui/NSView/NSView_frame_rotation.m +++ b/Tests/gui/NSView/NSView_frame_rotation.m @@ -18,7 +18,19 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) pass(passed,"-frameRotation/-setFrameRotation work"); + END_SET("NView GNUstep frame_rotation") + DESTROY(arp); return 0; } diff --git a/Tests/gui/NSView/scrollRectToVisible.m b/Tests/gui/NSView/scrollRectToVisible.m index 596bbc218..a0eefb2c3 100644 --- a/Tests/gui/NSView/scrollRectToVisible.m +++ b/Tests/gui/NSView/scrollRectToVisible.m @@ -29,7 +29,20 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) [v scrollRectToVisible: NSMakeRect(15,15,5,5)]; TEST(NSMakeRect(10,10,10,10),"12"); + END_SET("NView GNUstep scrollRectToVisible") + DESTROY(arp); return 0; } - diff --git a/Tests/gui/TextSystem/deallocation.m b/Tests/gui/TextSystem/deallocation.m index e0c2a8817..27b56f239 100644 --- a/Tests/gui/TextSystem/deallocation.m +++ b/Tests/gui/TextSystem/deallocation.m @@ -25,8 +25,19 @@ main(int argc, char **argv) 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 @@ main(int argc, char **argv) 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; } diff --git a/Tests/gui/TextSystem/repeatedAttachmentCellHeight.m b/Tests/gui/TextSystem/repeatedAttachmentCellHeight.m index f1907f74b..f1199b9d4 100644 --- a/Tests/gui/TextSystem/repeatedAttachmentCellHeight.m +++ b/Tests/gui/TextSystem/repeatedAttachmentCellHeight.m @@ -5,6 +5,8 @@ Check that the layour process doesn't get stuck if we try to make a cell fill the entire height of a line frag. */ +#include "Testing.h" + #include #include #include @@ -42,7 +44,18 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) [text endEditing]; [lm usedRectForTextContainer: tc]; + END_SET("TextSystem GNUstep repeatedAttachmentCellHeight"); + DESTROY(arp); return 0; }