3 # 03.14.2006 Volker Quetschke
4 # Verifies that $(shell ..) does not pick up stdout output from
5 # concurrent processes. (Stronger test for the spawn case.)
6 # (issue 61856 / issue 61940)
11 tmpfiles
="$file1 $file2"
13 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
15 trap 'rm -rf $tmpfiles' 1 2 3 15
17 # Remember to quote variables in generated makefiles( $ -> \$ ).
19 # Testing continuation char in recipes
24 @+echo "Y\$(DYNMAC)Y" > $file2
27 @+echo "Before the sleeps ..."
28 @+echo A; sleep 1; echo B; sleep 1; echo C; sleep 1; echo D; sleep 1; echo E
29 @+echo "After the sleeps ..."
33 @+echo "X\$(assign DYNMAC:=\$(shell @+echo "(shellpre)";sleep 2; echo "(shellpost)"))X"
37 ${DMAKEPROG} -P3 -r -f $file1
39 if test "`cat $file2`" != "Y(shellpre) (shellpost)Y"; then
40 echo "Wrong result: `cat $file2`, Y(shellpre) (shellpost)Y expected!"
44 test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
45 test $result -ne 0 && echo "Failure!"