gupascal / distcc

distcc: a fast, free distributed C/C++ compiler. Automatically exported from code.google.com/p/distcc
GNU General Public License v2.0
0 stars 0 forks source link

distcc tests not portable (hardcoded include path) #131

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago

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