bionic/tests/file-check-cxx
Dan Willemsen 808602a485 Fix file-check-cxx to handle quoted arguments
If the OVERRIDE_C_DATE_TIME environment variable is set, the build
system will add a macro to the global cflags that contains a static
quoted date, like:

  -D__DATE__="\"Sep 28 2015\""

file-check-cxx needs to properly pass that through as a single, still
quoted argument. So use the quoted "$@" instead of turning each word
into an argument.

Change-Id: I6929d712c280d0452062640e0cba8a176d045c97
2015-09-28 13:14:19 -07:00

14 lines
245 B
Bash
Executable File

#!/bin/bash
FILECHECK=$1
CXX=$2
PREFIX=$3
shift 3
SOURCE=$(echo "$@" | grep -oP '\S+\.cpp\b')
OBJ=$(echo "$@" | grep -oP '\S+\.o\b')
$CXX "$@" 2>&1 | $FILECHECK -check-prefix=$PREFIX $SOURCE
if [ "$?" -eq 0 ]; then
touch $OBJ
else
exit 1
fi