mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Adding test tool for @sync.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27009 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2e6a328757
commit
f9f8c417ef
8 changed files with 276 additions and 0 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2008-11-05 17:27-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Testing/synctest/GNUmakefile
|
||||
* Testing/synctest/GNUmakefile.postamble
|
||||
* Testing/synctest/GNUmakefile.preamble
|
||||
* Testing/synctest/main.m
|
||||
* Testing/synctest/PC.project
|
||||
* Testing/synctest/PC.project.backup
|
||||
* Testing/synctest/SyncTestInfo.plist: Added test tool for
|
||||
@synchronize.
|
||||
|
||||
2008-10-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/gdomap.c: Improve error messages and information about
|
||||
|
|
35
Testing/synctest/GNUmakefile
Normal file
35
Testing/synctest/GNUmakefile
Normal file
|
@ -0,0 +1,35 @@
|
|||
#
|
||||
# GNUmakefile - Generated by ProjectCenter
|
||||
#
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
|
||||
#
|
||||
# Tool
|
||||
#
|
||||
VERSION = 0.1
|
||||
PACKAGE_NAME = SyncTest
|
||||
TOOL_NAME = SyncTest
|
||||
SyncTest_TOOL_ICON =
|
||||
|
||||
|
||||
#
|
||||
# Resource files
|
||||
#
|
||||
SyncTest_RESOURCE_FILES = \
|
||||
Resources/Version \
|
||||
|
||||
|
||||
#
|
||||
# Other sources
|
||||
#
|
||||
SyncTest_OBJC_FILES += \
|
||||
main.m
|
||||
|
||||
#
|
||||
# Makefiles
|
||||
#
|
||||
-include GNUmakefile.preamble
|
||||
include $(GNUSTEP_MAKEFILES)/aggregate.make
|
||||
include $(GNUSTEP_MAKEFILES)/tool.make
|
||||
-include GNUmakefile.postamble
|
40
Testing/synctest/GNUmakefile.postamble
Normal file
40
Testing/synctest/GNUmakefile.postamble
Normal file
|
@ -0,0 +1,40 @@
|
|||
#
|
||||
# GNUmakefile.postamble - Generated by ProjectCenter
|
||||
#
|
||||
|
||||
# Things to do before compiling
|
||||
# before-all::
|
||||
|
||||
# Things to do after compiling
|
||||
# after-all::
|
||||
|
||||
# Things to do before installing
|
||||
# before-install::
|
||||
|
||||
# Things to do after installing
|
||||
# after-install::
|
||||
|
||||
# Things to do before uninstalling
|
||||
# before-uninstall::
|
||||
|
||||
# Things to do after uninstalling
|
||||
# after-uninstall::
|
||||
|
||||
# Things to do before cleaning
|
||||
# before-clean::
|
||||
|
||||
# Things to do after cleaning
|
||||
# after-clean::
|
||||
|
||||
# Things to do before distcleaning
|
||||
# before-distclean::
|
||||
|
||||
# Things to do after distcleaning
|
||||
# after-distclean::
|
||||
|
||||
# Things to do before checking
|
||||
# before-check::
|
||||
|
||||
# Things to do after checking
|
||||
# after-check::
|
||||
|
25
Testing/synctest/GNUmakefile.preamble
Normal file
25
Testing/synctest/GNUmakefile.preamble
Normal file
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# GNUmakefile.preamble - Generated by ProjectCenter
|
||||
#
|
||||
|
||||
# Additional flags to pass to the preprocessor
|
||||
ADDITIONAL_CPPFLAGS +=
|
||||
|
||||
# Additional flags to pass to Objective C compiler
|
||||
ADDITIONAL_OBJCFLAGS +=
|
||||
|
||||
# Additional flags to pass to C compiler
|
||||
ADDITIONAL_CFLAGS +=
|
||||
|
||||
# Additional flags to pass to the linker
|
||||
ADDITIONAL_LDFLAGS +=
|
||||
|
||||
# Additional include directories the compiler should search
|
||||
ADDITIONAL_INCLUDE_DIRS +=
|
||||
|
||||
# Additional library directories the linker should search
|
||||
ADDITIONAL_LIB_DIRS +=
|
||||
|
||||
# Additional TOOL libraries to link
|
||||
ADDITIONAL_TOOL_LIBS +=
|
||||
|
60
Testing/synctest/PC.project
Normal file
60
Testing/synctest/PC.project
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
CLASS_FILES = (
|
||||
);
|
||||
COMPILEROPTIONS = "";
|
||||
CPPOPTIONS = "";
|
||||
CREATION_DATE = "2008-11-04 19:40:49 -0500";
|
||||
DOCU_FILES = (
|
||||
);
|
||||
FRAMEWORKS = (
|
||||
);
|
||||
HEADER_FILES = (
|
||||
);
|
||||
IMAGES = (
|
||||
);
|
||||
INSTALLDIR = "$(HOME)/GNUstep/Tools";
|
||||
LANGUAGE = English;
|
||||
LAST_EDITING = "2008-11-05 17:26:50 -0500";
|
||||
LIBRARIES = (
|
||||
"gnustep-base"
|
||||
);
|
||||
LINKEROPTIONS = "";
|
||||
LOCALIZED_RESOURCES = (
|
||||
);
|
||||
MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)";
|
||||
OBJC_COMPILEROPTIONS = "";
|
||||
OTHER_RESOURCES = (
|
||||
Version
|
||||
);
|
||||
OTHER_SOURCES = (
|
||||
main.m
|
||||
);
|
||||
PROJECT_AUTHORS = (
|
||||
);
|
||||
PROJECT_COPYRIGHT = "Copyright (C) 200x";
|
||||
PROJECT_COPYRIGHT_DESC = "Released under ...";
|
||||
PROJECT_CREATOR = "Gregory John Casamento,,,";
|
||||
PROJECT_DESCRIPTION = "No description available!";
|
||||
PROJECT_GROUP = "No group available!";
|
||||
PROJECT_MAINTAINER = "Gregory John Casamento,,,";
|
||||
PROJECT_NAME = SyncTest;
|
||||
PROJECT_RELEASE = 0.1;
|
||||
PROJECT_SUMMARY = "No summary available!";
|
||||
PROJECT_TYPE = Tool;
|
||||
PROJECT_URL = "";
|
||||
SEARCH_HEADER_DIRS = (
|
||||
);
|
||||
SEARCH_LIB_DIRS = (
|
||||
);
|
||||
SUBPROJECTS = (
|
||||
);
|
||||
SUPPORTING_FILES = (
|
||||
GNUmakefile.preamble,
|
||||
GNUmakefile,
|
||||
GNUmakefile.postamble,
|
||||
SyncTestInfo.plist
|
||||
);
|
||||
TOOLICON = "";
|
||||
USER_LANGUAGES = (
|
||||
);
|
||||
}
|
60
Testing/synctest/PC.project.backup
Normal file
60
Testing/synctest/PC.project.backup
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
CLASS_FILES = (
|
||||
);
|
||||
COMPILEROPTIONS = "";
|
||||
CPPOPTIONS = "";
|
||||
CREATION_DATE = "2008-11-04 19:40:49 -0500";
|
||||
DOCU_FILES = (
|
||||
);
|
||||
FRAMEWORKS = (
|
||||
);
|
||||
HEADER_FILES = (
|
||||
);
|
||||
IMAGES = (
|
||||
);
|
||||
INSTALLDIR = "$(HOME)/GNUstep/Tools";
|
||||
LANGUAGE = English;
|
||||
LAST_EDITING = "2008-11-05 17:24:50 -0500";
|
||||
LIBRARIES = (
|
||||
"gnustep-base"
|
||||
);
|
||||
LINKEROPTIONS = "";
|
||||
LOCALIZED_RESOURCES = (
|
||||
);
|
||||
MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)";
|
||||
OBJC_COMPILEROPTIONS = "";
|
||||
OTHER_RESOURCES = (
|
||||
Version
|
||||
);
|
||||
OTHER_SOURCES = (
|
||||
main.m
|
||||
);
|
||||
PROJECT_AUTHORS = (
|
||||
);
|
||||
PROJECT_COPYRIGHT = "Copyright (C) 200x";
|
||||
PROJECT_COPYRIGHT_DESC = "Released under ...";
|
||||
PROJECT_CREATOR = "Gregory John Casamento,,,";
|
||||
PROJECT_DESCRIPTION = "No description available!";
|
||||
PROJECT_GROUP = "No group available!";
|
||||
PROJECT_MAINTAINER = "Gregory John Casamento,,,";
|
||||
PROJECT_NAME = SyncTest;
|
||||
PROJECT_RELEASE = 0.1;
|
||||
PROJECT_SUMMARY = "No summary available!";
|
||||
PROJECT_TYPE = Tool;
|
||||
PROJECT_URL = "";
|
||||
SEARCH_HEADER_DIRS = (
|
||||
);
|
||||
SEARCH_LIB_DIRS = (
|
||||
);
|
||||
SUBPROJECTS = (
|
||||
);
|
||||
SUPPORTING_FILES = (
|
||||
GNUmakefile.preamble,
|
||||
GNUmakefile,
|
||||
GNUmakefile.postamble,
|
||||
SyncTestInfo.plist
|
||||
);
|
||||
TOOLICON = "";
|
||||
USER_LANGUAGES = (
|
||||
);
|
||||
}
|
9
Testing/synctest/SyncTestInfo.plist
Normal file
9
Testing/synctest/SyncTestInfo.plist
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"!" = "Generated by ProjectCenter, do not edit";
|
||||
Copyright = "Copyright (C) 200x";
|
||||
CopyrightDescription = "Released under ...";
|
||||
FullVersionID = 0.1;
|
||||
ToolDescription = "No description available!";
|
||||
ToolName = SyncTest;
|
||||
ToolRelease = 0.1;
|
||||
}
|
36
Testing/synctest/main.m
Normal file
36
Testing/synctest/main.m
Normal file
|
@ -0,0 +1,36 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
static NSArray *array;
|
||||
|
||||
@interface SyncTest : NSObject
|
||||
- (void) sayHello;
|
||||
@end
|
||||
|
||||
@implementation SyncTest
|
||||
- (void) sayHello
|
||||
{
|
||||
NSLog(@"Before the sync block %@",[NSThread currentThread]);
|
||||
@synchronized(array) {
|
||||
NSLog(@"In the sync block %@:%d",[NSThread currentThread],[NSThread isMainThread]);
|
||||
NSLog(@"Waiting five seconds...");
|
||||
usleep(5000);
|
||||
NSLog(@"Done waiting");
|
||||
}
|
||||
NSLog(@"After the sync block %@",[NSThread currentThread]);
|
||||
}
|
||||
@end
|
||||
|
||||
int main (int argc, const char * argv[])
|
||||
{
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
SyncTest *st = [[SyncTest alloc] init];
|
||||
array = [NSArray arrayWithObjects: @"Hello World",nil];
|
||||
|
||||
[NSThread detachNewThreadSelector: @selector(sayHello)
|
||||
toTarget: st
|
||||
withObject: nil];
|
||||
[st sayHello];
|
||||
|
||||
[pool drain];
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue