Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / usr.bin / make / tests / variables / t2 / test.sh
1 #!/bin/sh
2
3 # $DragonFly: src/usr.bin/make/tests/variables/t2/test.sh,v 1.2 2005/03/03 19:13:00 okumoto Exp $
4
5 . ../../common.sh
6
7 setup_test()
8 {
9         cat > $WORK_BASE/Makefile << "_EOF_"
10 FILES   = \
11                 main.c globals.h \
12                 util.c util.h \
13                 map.c map.h \
14                 parser.y lexer.l \
15                 cmdman.1 format.5
16 ORANGE  = Variable Variable Variable Variable
17 APPLE   = AAA BBB CCC
18 all:
19         @echo "Old: ${FILES}"
20         @echo "New: ${FILES:S/map/Map/}"
21         @echo "New: ${FILES:S/main/&_wrapper/}"
22
23         @echo "${ORANGE:S/Variable/Integer/g}"
24         @echo "${ORANGE:S/Variable/Integer/}"
25
26         @echo "${APPLE:S/A/FOO/g}"
27         @echo "${APPLE:S/B/BAR/g}"
28         @echo "${APPLE:S/C/BAZ/g}"
29
30         @echo "${APPLE:S/^A/FOO/g}"
31         @echo "${APPLE:S/^B/BAR/g}"
32         @echo "${APPLE:S/^C/BAZ/g}"
33
34         @echo "${APPLE:S/A$/FOO/g}"
35         @echo "${APPLE:S/B$/BAR/g}"
36         @echo "${APPLE:S/C$/BAZ/g}"
37 _EOF_
38 }
39
40 desc_test()
41 {
42         echo "Variable expansion with M modifier"
43 }
44
45 eval_cmd $1