merge the formfield patch from ooo-build
[ooovba.git] / dmake / tests / infra-0
blob494ffa44283a1873e8e20b3400988339184c33d0
1 #!/bin/sh
3 # 01.06.2005 Volker Quetschke
4 # Basic test of dmake existence and the needed infrastructure.
6 : ${DMAKEPROG:=dmake}
7 file1="mymakefile.mk"
8 file2="mytestfile"
9 tmpfiles="$file1 $file2"
11 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
13 # Test for "test" programm in path
14 which test > /dev/null || { echo "Failure! \"test\" program missing." ; exit 1; }
15 echo "Found \"test\" program."
16 test=`which test`
18 # Test for "echo" programm in path
19 which echo > /dev/null || { echo "Failure! \"echo\" program missing." ; exit 1; }
20 echo "Found \"echo\" program."
22 # Test for dmake program
23 ${test} -x "${DMAKEPROG}" || { echo "Failure! \"dmake\" is missing." ; exit 1; }
24 echo "Found \"dmake\" program."
26 # Remember to quote variables in generated makefiles( $ -> \$ ).
27 cat > $file1 <<EOT
28 # simple makefile
29 ${file2}:
30 @echo 'Generating ${file2}'
31 touch ${file2}
32 EOT
34 ${DMAKEPROG} -r -f $file1
35 result=$?
36 if ${test} ! -e "${file2}"; then
37 echo "File missing"
38 result=1
41 ${test} $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
42 ${test} $result -ne 0 && echo "Failure!"
43 exit $result