Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distcc tests not portable (hardcoded include path) #131

Open
GoogleCodeExporter opened this issue May 26, 2015 · 2 comments
Open

distcc tests not portable (hardcoded include path) #131

GoogleCodeExporter opened this issue May 26, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

distcc 3.1 on Haiku (www.haiku-os.org). Compiler is gcc 2.95.3+some custom 
patches.
I'm working on porting distcc to Haiku. I got it to build (after some C89 
compatibility fixes) and I'm now trying to run the testsuite.

The following test fails:
class CPlusPlus_SystemIncludeDirectories_Case(CPlusPlus_Case):
    """Test -I/usr/include/sys for a C++ program"""

    def compileOpts(self):
        if os.path.exists("/usr/include/sys/types.h"):
          return "-I/usr/include/sys"
        else:
          raise comfychair.NotRunError (
              "This test requires /usr/include/sys/types.h")

    def headerSource(self):
        return """
#define MESSAGE "hello world"
"""

    def source(self):
        return """
#include "types.h"    /* Should resolve to /usr/include/sys/types.h. */
#include "testhdr.h"
#include <stdio.h>
int main(void) {
    puts(MESSAGE);
    return 0;
}
"""
    def checkBuiltProgramMsgs(self, msgs):
        self.assert_equal(msgs, "hello world\n")

There are at least two problems here:
 - our headers are not located in /usr/include. The one this test is looking for would be in /boot/system/develop/headers/posix/sys
 - our types.h #includes <time.h>, expecting to find the one in the parent directory. With the sys directory drectly in the include path, it finds the wrong one and fails to compile.

It seems many tests use hardcoded include path which won't work for us. I know 
our FS layout is a bit unusual, but...

Original issue reported on code.google.com by pulkoma...@gmail.com on 2 Oct 2013 at 6:36

@GoogleCodeExporter
Copy link
Author

I understand that these tests are not completely portable.
But I think they serve a useful function on most systems, and making them 
portable would be a lot of work.
Feel free to send a patch to disable this test (raise comfychair.NotRunError) 
on your system, along with any others that have similar problems -- that's 
probably the most pragmatic solution IMHO.

Original comment by fergus.h...@gmail.com on 2 Oct 2013 at 7:28

@GoogleCodeExporter
Copy link
Author

Original comment by fergus.h...@gmail.com on 2 Oct 2013 at 7:28

  • Changed state: Accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant