diff options
-rwxr-xr-x | dmake/tests/infra-0 | 42 | ||||
-rwxr-xr-x | dmake/tests/macros-1 | 40 | ||||
-rwxr-xr-x | dmake/tests/recipes-1 | 37 |
3 files changed, 119 insertions, 0 deletions
diff --git a/dmake/tests/infra-0 b/dmake/tests/infra-0 new file mode 100755 index 000000000000..97c2962be3d8 --- /dev/null +++ b/dmake/tests/infra-0 @@ -0,0 +1,42 @@ +#!/bin/sh + +# 01.06.2005 Volker Quetschke +# Basic test of dmake existence and the needed infrastructure. + +: ${DMAKEPROG:=dmake} +file1="mymakefile.mk" +file2="mytestfile" +tmpfiles="$file1 $file2" + +trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15 + +# Test for "test" programm in path +which test > /dev/null || { echo "Failure! \"test\" program missing." ; exit 1; } +echo "Found \"test\" program." + +# Test for "echo" programm in path +which echo > /dev/null || { echo "Failure! \"echo\" program missing." ; exit 1; } +echo "Found \"echo\" program." + +# Test for dmake program +test -x "${DMAKEPROG}" || { echo "Failure! \"dmake\" is missing." ; exit 1; } +echo "Found \"dmake\" program." + +# Remember to quote variables in generated makefiles( $ -> \$ ). +cat > $file1 <<EOT +# simple makefile +${file2}: + @echo 'Generating ${file2}' + touch ${file2} +EOT + +${DMAKEPROG} -r -f $file1 +result=$? +if test ! -e "${file2}"; then + echo "File missing" + result=1 +fi + +test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles} +test $result -ne 0 && echo "Failure!" +exit $result
\ No newline at end of file diff --git a/dmake/tests/macros-1 b/dmake/tests/macros-1 new file mode 100755 index 000000000000..35983b4e3fac --- /dev/null +++ b/dmake/tests/macros-1 @@ -0,0 +1,40 @@ +#!/bin/sh + +# 01.06.2005 Volker Quetschke +# Tests for special dmake macros. +# (issue 37491) + +: ${DMAKEPROG:=dmake} +file1="mymakefile.mk" +tmpfiles="$file1" + +trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15 + +trap 'rm -rf $tmpfiles' 1 2 3 15 + +# Remember to quote variables in generated makefiles( $ -> \$ ). +cat > $file1 <<EOT +# Testing macros +SHELL*:=/bin/sh +SHELLFLAGS*:=-ce + +TEST1:=a b c +PAT:=Z + +all: + +@echo -e '\n\$\$(SPACECHAR) section' + +test ": :" = ":\$(SPACECHAR):" + + +@echo -e '\n\$\$(MACRO:s/pat/rep/) section' + +test ":aZbZc:" = ":\$(TEST1:s/ /Z/):" + +test ":aZbZc:" = ":\$(TEST1:s/\$(SPACECHAR)/Z/):" + +test ":aZbZc:" = ":\$(TEST1:s/ /\$(PAT)/ ):" + +EOT + +${DMAKEPROG} -r -f $file1 +result=$? + +test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles} +test $result -ne 0 && echo "Failure!" +exit $result
\ No newline at end of file diff --git a/dmake/tests/recipes-1 b/dmake/tests/recipes-1 new file mode 100755 index 000000000000..56033678f12f --- /dev/null +++ b/dmake/tests/recipes-1 @@ -0,0 +1,37 @@ +#!/bin/sh + +# 01.06.2005 Volker Quetschke +# Tests for line continuation in recipes. +# (issue 37053) + +: ${DMAKEPROG:=dmake} +file1="mymakefile.mk" +tmpfiles="$file1" + +trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15 + +trap 'rm -rf $tmpfiles' 1 2 3 15 + +# Remember to quote variables in generated makefiles( $ -> \$ ). +cat > $file1 <<EOT +# Testing continuation char in recipes +SHELL*:=/bin/sh +SHELLFLAGS*:=-ce + +all: + +@echo line1\ +line2 + +EOT + +output=$(${DMAKEPROG} -r -f $file1) +result=$? +if test "$output" != "line1line2"; then + echo "Wrong result" + result=1 +fi + + +test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles} +test $result -ne 0 && echo "Failure!" +exit $result
\ No newline at end of file |