summaryrefslogtreecommitdiff
path: root/tests/t0011-base-include-path.sh
diff options
context:
space:
mode:
authorkx <kx@radix-linux.su>2026-10-01 12:02:28 +0300
committerkx <kx@radix-linux.su>2026-10-01 12:02:28 +0300
commitba1b04d64bdfaf377915b22f77520216ebe47674 (patch)
tree044343035c28b2b04ca9725f26e9b7c39342d19c /tests/t0011-base-include-path.sh
parent124b140798456778e2a96851cc7268aa9a726698 (diff)
downloadmcpu-cpp-1.0.2.tar.xz
Version 1.0.21.0.2
Diffstat (limited to 'tests/t0011-base-include-path.sh')
-rwxr-xr-xtests/t0011-base-include-path.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/t0011-base-include-path.sh b/tests/t0011-base-include-path.sh
new file mode 100755
index 0000000..f862e88
--- /dev/null
+++ b/tests/t0011-base-include-path.sh
@@ -0,0 +1,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