Ticket #11169: 11169_testcc.patch

File 11169_testcc.patch, 787 bytes (added by jdemeyer, 8 years ago)
  • spkg/bin/testcc.sh

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1333361103 -7200
    # Node ID 75d76923aed299917e7bef56d4ea9f7fbf4f71eb
    # Parent  6814e0bc0ef4eb9984d0b0fe7f4eff4c308ab604
    Make testcc.sh exit with an exit code of 1 if preprocessing a file fails.
    
    diff --git a/spkg/bin/testcc.sh b/spkg/bin/testcc.sh
    a b  
    111111#endif
    112112E*O*F
    113113
     114# Attempt to compile the file and check there's not
     115# an error. If an error is produced, exit with an error
     116# code of 1.
     117
     118${CC_LOCAL} -E $TESTFILE > /dev/null 2>&1
     119if [ $? -ne 0 ]  ; then
     120   echo "Error - $CC_LOCAL is not compiling a C file properly"
     121   rm $TESTFILE
     122   exit 1
     123fi
     124
    114125${CC_LOCAL} -E $TESTFILE | grep '^[A-Z]' | sed 's/ //g'
    115126rm $TESTFILE
    116127exit 0