summaryrefslogtreecommitdiff
path: root/tests/t0011-base-include-path.sh
blob: f862e888d0564bbdefcfd5de90d53e51046296a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
set -eu
dir="${TMPDIR-/tmp}/mcpu-cpp-basepath-$$"
mkdir -p "$dir"
trap 'rm -rf "$dir"' EXIT HUP INT TERM
cat > "$dir/config" <<EOT
MCPU_CPP_INCLUDE_PATH = $srcdir/data/lang-base;
EOT
"$MCPU_CPP" --config-file "$dir/config" "$srcdir/data/base-path-main.c" -o "$dir/base.out"
grep 'from_base_language_include_root' "$dir/base.out" >/dev/null
cat > "$dir/as.c" <<'EOT'
#lang "as"
#include <base.h>
#include <diff/explicit.h>
#endlang
EOT
"$MCPU_CPP" --config-file "$dir/config" "$dir/as.c" -o "$dir/as.out"
grep 'from_base_language_include_root' "$dir/as.out" >/dev/null
grep 'from_explicit_diff_subdirectory' "$dir/as.out" >/dev/null