Bug 513747 makes it impossible to run mochitests for me. The problem is that the test harness sets DYLD_LIBRARY_PATH for the xpcshell and ssltunnel runs. Apparently it has to do that even on OSX for test runs on packaged builds.
Yeah, I'm not sure what the right thing to do here is. I know we need to set it for running things like xpcshell/certutil for packaged builds, since those binaries will actually be in a separate directory.
fwiw, to test chrome / content mochitests, i made it work by replacing DYLD_LIBRARY_PATH with LD_LIBRARY_PATH in automation.py
also, commenting out the offending DYLD lines also works, though I did manually set --utility-dir in runtests.py. Not sure if that was the magic bit or not.
Confirming that replacing DYLD_LIBRARY_PATH with LD_LIBRARY_PATH in BOTH automation.py.in and runtest.py.in helps.
Which is exactly the same as removing them. LD_LIBRARY_PATH doesn't do anything on OS X. We could patch this, but simply removing the env vars would break our existing unit test setup, since we run everything from the packaged builds. If someone wanted to fix this, you should be able to remove them from the environment used to run the browser, but leave them in the environment used to run xpcshell/ssltunnel.
This is fixed on trunk by bug 513747.