diff options
Diffstat (limited to 'tests/t0017-macro-errors.sh')
| -rwxr-xr-x | tests/t0017-macro-errors.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/t0017-macro-errors.sh b/tests/t0017-macro-errors.sh new file mode 100755 index 0000000..f54f74c --- /dev/null +++ b/tests/t0017-macro-errors.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -eu +src="${TMPDIR-/tmp}/mcpu-cpp-macro-errors-$$.c" +out="${TMPDIR-/tmp}/mcpu-cpp-macro-errors-$$.out" +err="${TMPDIR-/tmp}/mcpu-cpp-macro-errors-$$.err" +trap 'rm -f "$src" "$out" "$err"' EXIT HUP INT TERM +cat > "$src" <<'EOT' +#define +EOT +if "$MCPU_CPP" --no-config "$src" -o "$out" 2>"$err"; then + exit 1 +fi +grep 'macro name expected after #define' "$err" >/dev/null |
