You don't need to ship a shared library in order to compile an executable that dynamically links to said shared library. You just need the header files listing the shared library's exported symbols. You can treat Cocoa like any other closed-source blob of a vendor library.
If the application is well-structured, you can run many types of tests without ever touching the UI. You can also run things like linters and static analysis tools (although those are usually platform-agnostic).
This isn't my exact area either, so my terminology is probably off, but one way to do this would be to compile the "backend" code separately and run unit tests on that. Treat it as a library in your application, if you will.
Another approach I've heard used was just faking the library from the headers - as long nothing from it is called in the course of your testing, your program wouldn't notice.
> Oracle’s lawyers wrote. "The next Oracle will think twice about investing as heavily in a venture like Java if it knows that any competitor could freely copy its work to compete directly against it."
It would make me terribly happy if Oracle would refrain from doing so. I think this case is ridiculous. The same developer implemented a range check in the same way he did 10 years ago. Yes, copyright for software is broken...
And the lines in question were even removed, which is a tragedy itself, but I cannot see Oracle as anything but hugely detrimental to software. Developers should ignore anything they touch.
If they do indeed rule in favor of Oracle, it wouldn't be undermining OSS, it would undermine the whole judiciary system. It would be scientifically proven bullshit.
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex {
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex(" + fromIndex +
") > toIndex(" + toIndex+")");
if (fromIndex < 0)
throw new ArrayIndexOutOfBoundsException(fromIndex);
if (toIndex > arrayLen)
throw new ArrayIndexOutOfBoundsException(toIndex);
}