hi Yen-Ju,
Sorry to have been a bit slow to reply.
Le 12 mars 05, à 18:18, Yen-Ju Chen a écrit :
On Sat, 12 Mar 2005 13:52:49 +0100, Quentin Mathé
<[EMAIL PROTECTED]> wrote:
***
For include :
I plan to have a flat header directory.
Right now, it is just for porting
so that I can monitor the progress easily.
Once I finish the porting and the headers are stable,
I will put them into a flat directory.
ok
The first solution is better in my opinion because the tests bundle
would have the possibility to be used without LuceneKit source code.
I do not understand what you mean here. :)
Sorry my explanations were written too quickly, by the way confusing…
The first solution is :
- Use a GNUmakefile.postamble in the "LuceneKit" base directory to
create a temporary directory with path MyFolder/LuceneKit/LuceneKit.
This directory will be just a symbolic link on
MyFolder/LuceneKit/Headers in order to allow writing #import
<LuceneKit/Whatever.h> in your tests files stored in
MyFolder/LuceneKit/Tests
GNUmakefile.postamble example :
before-all::
rm -rf ./LuceneKit
$(LN_S) ./Headers ./LuceneKit
after-clean::
rm -rf ./LuceneKit
Then in Util folder GNUmakefile you could replace :
LuceneKit_Util_INCLUDE_DIRS += -I../../Headers -I../
by :
LuceneKit_Util_INCLUDE_DIRS += -I../.. -I../
For Test folder GNUmakefile you need write :
Test_INCLUDE_DIRS = -I../
However you need to have a flattened headers folder to do that.
To have the Tests bundle working with GNUstep on Mac OS X I wrote in
GNUmakefile :
Test_LDFLAGS = -lUnitKit -lLuceneKit
Test_LIB_DIRS = -L../Source/$(GNUSTEP_OBJ_DIR)
Test_INCLUDE_DIRS = -I../Headers/
Could you send a patch for this ?
Here is my Test folder GNUmakefile :
include $(GNUSTEP_MAKEFILES)/common.make
BUNDLE_NAME = Test
Test_OBJC_FILES = \
TestStringHelper.m \
TestBitVector.m \
TestDocument.m \
TestStringReader.m \
TestAnalysis.m \
TestDateTools.m \
TestNumberTools.m
#ifeq ($(FOUNDATION_LIB), apple)
# Test_OBJC_LIBS += -framework UnitKit
#else
# Test_OBJC_LIBS= -lUnitKit
#endif
Test_LDFLAGS = -lUnitKit -lLuceneKit
Test_LIB_DIRS = -L../Source/$(GNUSTEP_OBJ_DIR)
Test_INCLUDE_DIRS = -I../Headers/ # or combined with the previous
solution Test_INCLUDE_DIRS = -I../
include $(GNUSTEP_MAKEFILES)/bundle.make
Now, I can only test with cocoa (don't have PC/Unix around).
Me too ;-) Just install GNUstep on Mac OS X with Adam Fedor new install
script, it should works well.
I can help you to install GNUstep on Mac OS X, just send me a private
mail.
Not sure but may be there are bugs in gnustep-make because
Test_OBJC_LIBS and Test_HEADERS_DIRS cannot be used, their values
seems
to be ignored
There is still a problem however, out of the box the linker won't find
libLuceneKit, you need to adjust LD_LIBRARY_PATH (or
DYLD_LIBRARY_PATH)
or rely on static linking, I think it's better to keep dynamic linking
to avoid recompile process when not needed.
The fact is… my previous GNUmakefile proposal will work only if you
add
../Source/$(GNUSTEP_OBJ_DIR) value to your LD_LIBRARY_PATH (or
DYLD_LIBRARY_PATH). What I can do to improve this : may be parse
LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH) when ukrun is started and
retrieves the right value by parsing GNUmakefile in tests folders,
finally when ukrun exits I would take the time to clean
LD_LIBRARY_PATH…
Any comments ? May be I have missed a more obvious and elegant
solution.
I do have problems with link and haven't have time to solve it.
I believe there is an easy solution
but I just don't have time to play around it yet. :)
hehe
How do you put the test in the classes ?
Just write in the header file :
@interface WhateverClass : NSObject <UKTest>
{
}
@end
And in implementation file :
@implementation WhateverClass
// Optional
- (id) initForTest
{
return myTestObject;
}
// Optional
- (void) releaseForTest
{
}
// The name of test method is not important, UnitKit just calls every
methods starting with "test" on your test object instance
- (void) testShowHelloWorld
{
Write test code here;
}
- (void) showHelloWorld: (NString *)hello
{
blabla
}
@end
Take note that a new test object is instantiated for each test method
called.
Example :
<http://cvs.gna.org/viewcvs/etoile/Etoile/Frameworks/ServicesBarKit/
SBServicesBar.m?rev=1.1.1.1&content-type=text/vnd.viewcvs-markup>
The classes are complied as library
and the test are bundle.
Do you have an example ?
<http://cvs.gna.org/viewcvs/etoile/Etoile/Frameworks/ServicesBarKit/
GNUmakefile?rev=1.1.1.1&content-type=text/vnd.viewcvs-markup>
Do you mean puting the classes and test in the same
directory or in the same file ?
I hope it's more clear now, just in the same implementation file where
the methods you want to test are located :-)
There is one test failing with GNUstep it seems ;-) :
TestDateTools.m: 20: warning: msgUKStringsEqual.fail
It is about millisecond.
Maybe there is a bug in GNUstep.
It is not used by GNUstep though (there is no way to set
millisecond).
ok
Let me know when you want to use Étoilé cvs for LuceneKit.
Probably after I port every classes and put the copyright in.
I want to make sure I can finish it before putting into CVS.
And I would like to have a stable directory structure (ex. flat
headers) before it goes into CVS.
ok, no problem. However I think, when you will know directory structure
won't change a lot, it would be better to put in cvs a bit too early
than much later in order to keep basic history of development
evolution.
Quentin.
--
Quentin Mathé
[EMAIL PROTECTED]