Re: SenTestingKit fails when using CG-Only (Fixed)

  • > On $BJ?@.(B 19/11/10, at 11:19, Chris Hanson wrote:
    >> On Nov 9, 2007, at 1:55 PM, Timothy Reaves wrote:
    >>
    >>> I also had to recompile the framework; otherwise, it'd link and
    >>> run, but no tests were executed.
    >>
    >> Thanks for letting me know.  I know you were one of the people I
    >> provided with the same instructions I gave Andre about this case,
    >> but I haven't yet heard back about whether those instructions worked.
    >>
    >>> Anyone testing please make sure to file a defect.  It's ridicules
    >>> to have to jump through these hoops to be able to test.  You
    >>> wouldn't tolerate compiling your own gcc to support gc.
    >>
    >> Please understand that all work is prioritized, and that sometimes
    >> the priorities may not be what you want them to be for a variety of
    >> reasons.  You're certainly welcome to disagree with the
    >> prioritization, but remember that you'll attract more flies with
    >> honey than with vinegar; there's no need to be insulting in your
    >> disagreement.

    Well, appending to this:

    I got it working, just built a new tool from scratch (I don't know why
    the previous project was passing the framework as the last
    argument...), but a few caveats.

    1)     It would still not load the SenTestingKit correctly. Even if I set
    - rpath manually, it still referenced it from @rpath/
    SenTestingKit.framework/Versions/A/SenTestingKit
    Putting the framework into one of the framework directories fixed
    this...... (as a side note, Xcode is installed into my user folder)

    2)    With the code below, it would not find any tests unless I pre-
    loaded the bundle of my test, like so: [[NSBundle bundleWithPath:
    [[[NSProcessInfo processInfo] arguments] lastObject]] load];

    3)    Since the tool is built with gc turned off, it had to be built with
    fobjc-gc or higher.

    > I have not heard back from anyone about whether it has not worked
    > for them.  Your input above is valuable in that it sounds like the
    > instructions I provided *don't* work (though they should have).
    Hope this helps.

    And... here is the code:

    int main (int argc, const char * argv[]) {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    //Making these variables just makes the following easier to read
    NSString *lastArgument = [[[NSProcessInfo processInfo] arguments]
    lastObject];
    NSNumber *yesATool = [NSNumber numberWithBool:YES];

    // Tell SenTestingKit to use our last argument as the test bundle, to
    // run all the tests it can find, and that the executable is equivalent
    // to the otest test rig supplied with OCUnit.
    NSDictionary *testDefaults = [NSDictionary
    dictionaryWithObjectsAndKeys:     lastArgument, SenTestedUnitPath,
                      SenTestScopeAll, SenTestScopeKey,
                      yesATool, SenTestToolKey,
                      nil];

    NSLog(@"Your (Garbage Collected) Test Suite is %@ \n",lastArgument);

    //Register the defaults so the test probe knows what to probe
    [[NSUserDefaults standardUserDefaults] registerDefaults:testDefaults];

    //Load the test bundle beforehand or it wont work...
    [[NSBundle bundleWithPath:lastArgument] load];

    //Probing
    [SenTestProbe runTests:testDefaults];

    [pool drain];
    return 0;
    }

    Andre
  • On Nov 11, 2007, at 12:15 AM, <listposter...> wrote:

    >> Well, appending to this:
    >
    > I got it working, just built a new tool from scratch (I don't know
    > why the previous project was passing the framework as the last
    > argument...), but a few caveats.

    Great to hear, thanks a ton for the update!

    > 1)     It would still not load the SenTestingKit correctly. Even if I
    > set - rpath manually, it still referenced it from @rpath/
    > SenTestingKit.framework/Versions/A/SenTestingKit
    > Putting the framework into one of the framework directories fixed
    > this...... (as a side note, Xcode is installed into my user folder)

    You can the appropriate search paths to your test rig by adding "$
    (DEVELOPER_LIBRARY_DIR)/Frameworks" to the "Runpath Search Paths"
    build setting in your test rig's target.  You can also specify the
    environment variable DYLD_FALLBACK_FRAMEWORK_PATH as "$
    (DEVELOPER_LIBRARY_DIR)/Frameworks" in your test rig's executable
    within Xcode so when dyld can't resolve that @rpath-relative build
    setting, it looks in the running Developer Tools folder's Library/
    Frameworks.  Either should work.

    > 2)    With the code below, it would not find any tests unless I pre-
    > loaded the bundle of my test, like so: [[NSBundle bundleWithPath:
    > [[[NSProcessInfo processInfo] arguments] lastObject]] load];

    Oh, good catch!

    > 3)    Since the tool is built with gc turned off, it had to be built
    > with fobjc-gc or higher.

    Right, sorry I forgot to mention this too.

    Thanks for giving this a try, I'm glad it works for you now and I'm
    sure you've helped out a lot of other people too!

      -- Chris
  • On $BJ?@.(B 19/11/11, at 17:26, Chris Hanson wrote:

    > On Nov 11, 2007, at 12:15 AM, <listposter...> wrote:
    >
    >>> Well, appending to this:
    >>
    >> I got it working, just built a new tool from scratch (I don't know
    >> why the previous project was passing the framework as the last
    >> argument...), but a few caveats.
    >
    > Great to hear, thanks a ton for the update!
    >
    >> 1)     It would still not load the SenTestingKit correctly. Even if I
    >> set - rpath manually, it still referenced it from @rpath/
    >> SenTestingKit.framework/Versions/A/SenTestingKit
    >> Putting the framework into one of the framework directories fixed
    >> this...... (as a side note, Xcode is installed into my user folder)
    >
    > You can the appropriate search paths to your test rig by adding "$
    > (DEVELOPER_LIBRARY_DIR)/Frameworks" to the "Runpath Search Paths"
    > build setting in your test rig's target.  You can also specify the
    > environment variable DYLD_FALLBACK_FRAMEWORK_PATH as "$
    > (DEVELOPER_LIBRARY_DIR)/Frameworks" in your test rig's executable
    > within Xcode so when dyld can't resolve that @rpath-relative build
    > setting, it looks in the running Developer Tools folder's Library/
    > Frameworks.  Either should work.
    Arghhghh, forgot /Frameworks......

    >
    >> 2)    With the code below, it would not find any tests unless I pre-
    >> loaded the bundle of my test, like so: [[NSBundle bundleWithPath:
    >> [[[NSProcessInfo processInfo] arguments] lastObject]] load];
    >
    > Oh, good catch!
    >
    >> 3)    Since the tool is built with gc turned off, it had to be built
    >> with fobjc-gc or higher.
    >
    > Right, sorry I forgot to mention this too.
    >
    > Thanks for giving this a try, I'm glad it works for you now and I'm
    > sure you've helped out a lot of other people too!
    Thanks for helping me get this working!!

    Andre

    >
    > -- Chris
    >
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today