diff options
| author | kx <kx@radix-linux.su> | 2026-10-01 12:02:28 +0300 |
|---|---|---|
| committer | kx <kx@radix-linux.su> | 2026-10-01 12:02:28 +0300 |
| commit | ba1b04d64bdfaf377915b22f77520216ebe47674 (patch) | |
| tree | 044343035c28b2b04ca9725f26e9b7c39342d19c /tests/t0012-user-config-path.sh | |
| parent | 124b140798456778e2a96851cc7268aa9a726698 (diff) | |
| download | mcpu-cpp-1.0.2.tar.xz | |
Version 1.0.21.0.2
Diffstat (limited to 'tests/t0012-user-config-path.sh')
| -rwxr-xr-x | tests/t0012-user-config-path.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/t0012-user-config-path.sh b/tests/t0012-user-config-path.sh new file mode 100755 index 0000000..54b6e64 --- /dev/null +++ b/tests/t0012-user-config-path.sh @@ -0,0 +1,26 @@ +#!/bin/sh +set -eu +dir="${TMPDIR-/tmp}/mcpu-cpp-userconf-$$" +mkdir -p "$dir/home/.mcpu" "$dir/include" "$dir/system/as" +trap 'rm -rf "$dir"' EXIT HUP INT TERM +cat > "$dir/home/.mcpu/mcpu-cpp.conf" <<EOT +MCPU_CPP_INCLUDE_PATH = $dir/include; +MCPU_CPP_SYSTEM_INCLUDE_PATH = $dir/system; +EOT +cat > "$dir/include/userconf.h" <<'EOT' +int from_user_mcpu_configuration; +EOT +cat > "$dir/system/as/system-userconf.h" <<'EOT' +int from_user_system_root; +EOT +cat > "$dir/main.c" <<'EOT' +#include <userconf.h> +#lang "as" +#include <system-userconf.h> +#endlang +EOT +HOME="$dir/home" "$MCPU_CPP" "$dir/main.c" -o "$dir/out" +grep 'from_user_mcpu_configuration' "$dir/out" >/dev/null +grep 'from_user_system_root' "$dir/out" >/dev/null +HOME="$dir/home" "$MCPU_CPP" -dconfig > "$dir/config.out" +grep "^MCPU_CPP_SYSTEM_INCLUDE_PATH = $dir/system;$" "$dir/config.out" >/dev/null |
