summaryrefslogtreecommitdiff
path: root/dmake/tests/misc-13
blob: 7493e744b6b64e6eb3d56033e15e2c3743995342 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh

# 29.09.2006 Volker Quetschke
# Check if the directory cache can be made case insensitive
# (issue 69814)

: ${DMAKEPROG:=dmake}
file1="mfile1.mk"
file2="TeSt.target"
tmpfiles="$file1 $file2"

trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15

# Remove files from prior failed run
rm -rf $tmpfiles

echo "Something" > $file2

# Remember to quote variables in generated makefiles ( $ -> \$ ).
# Also quote line continuations ( \<nl> -> \\<nl> ).
cat > $file1 <<EOT
SHELL*:=/bin/sh 
SHELLFLAGS*:=-ce

.DIRCACHE=yes

# Only test the directory cache for case insensitivity if the FS is also 
# case insensitive.
.IF "\$(.DIRCACHERESPCASE)"!="y"
test.target :
	@echo "Building \$@"

.ELSE
TeSt.target :
	@echo "Building \$@"

.ENDIF

EOT

output=`eval ${DMAKEPROG} -vm -r -f $file1`
result=$?

if echo "$output" | grep -v ".target' is up to date"  > /dev/null 2>&1 ; then
  echo "Wrong result: ${output}"
  result=1
fi 
 
test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
test $result -ne 0 && echo "Failure!"
exit $result