language-c-inline icon indicating copy to clipboard operation
language-c-inline copied to clipboard

Tests fail on Linux

Open olorin opened this issue 11 years ago • 3 comments

I'm not sure if this is expected behaviour or not (if it is, it'd be useful if this was mentioned in the README).

In tests/objc/concept/TestInlineObjC.hs on line 8, Foundation/Foundation.h is imported; as far as I can tell this is part of Cocoa and thus Apple-specific, so cabal install will fail in a confusing manner if cabal-install is configured to build tests by default.

olorin avatar May 08 '14 06:05 olorin

I think, this is inevitable as the Objective-C function that we call inline +[NSString stringWithContentsOfURL:encoding:error] is also Cocoa-specific and does require including Foundation/Foundation.h. Did I overlook anything?

mchakravarty avatar May 11 '14 10:05 mchakravarty

The beginning of README.md states "[..] to provide inline C and Objective-C in Haskell.", which is not platform specific.

If the library is only meant to work on OS X that should be explicitly stated. If the library is meant to work on several platforms the test suite should disable tests that can not be run on the current platform and run the remaining tests. Failing test suites makes it harder to contribute for occasional contributors since they can't tell whether tests are expected to fail, their setup is somehow broken, or if their changes broke things in new and interesting ways. As a bonus it's really easy to write the instructions for contributing if you have it this way: "run cabal test and make sure that it says ok".

I'm not sure if the conditional OS flags available in cabal work directly at the top level. If they don't work, perhaps the detailed interface of test suites can be used to make Cocoa-tests a no-op on other platforms?

pjonsson avatar May 13 '14 11:05 pjonsson

The library is supposed to be platform independent. At the moment, the tests are platform specific and fail to be disabled for platforms they can't run on, because I haven't had the time to write a more general set up.

I agree with everything you are saying and the plan is to implement all that (and more). It will just take a while as this is a rather young project and I have only got limited resources. However, I'm always happy for others to help out as well.

mchakravarty avatar May 14 '14 00:05 mchakravarty