summaryrefslogtreecommitdiff
path: root/tests/other-tests/import-environment.test
blob: 195434b550ac01da59bed6b19b00767842ff8c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# import-environment.test is part of the GNU m4 testsuite

. ${srcdir}/defs

TEST='This is an environment variable'
export TEST

ZAPPED='This is an environment variable which we will delete'
export ZAPPED

OVERRIDE='This is an environment variable which we will change'
export OVERRIDE

cat ${srcdir}/other-tests/import-environment.m4 >in

cat <<\EOF >ok
TEST=This is an environment variable
LANGUAGE=C
ZAPPED=ZAPPED
OVERRIDE=It is changed.
EOF

M4PATH=$srcdir:$srcdir/other-tests \
$M4 --import-environment -UZAPPED -DOVERRIDE='It is changed.' -d in >out 2>err
sed -e "s, ../../src/m4:, m4:," err >sederr && mv sederr err
$CMP -s out ok