summaryrefslogtreecommitdiff
path: root/dmake/tests
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-04-20 11:16:42 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-04-20 11:16:42 +0000
commitde610f2dcef5d21ce6e73e4f1b531c09b11ddd13 (patch)
tree7060a4682ba14a458d8d35b36f4c68f848e1d148 /dmake/tests
parentb2eeb057044754e0a023bfe064b879e7bc1f14ab (diff)
INTEGRATION: CWS dmake43p01 (1.1.2); FILE ADDED
2005/10/11 18:01:42 vq 1.1.2.1: #i39248# Add testcase and regenerate configure and other autotools files.
Diffstat (limited to 'dmake/tests')
-rwxr-xr-xdmake/tests/misc-462
1 files changed, 62 insertions, 0 deletions
diff --git a/dmake/tests/misc-4 b/dmake/tests/misc-4
new file mode 100755
index 000000000000..27eca02e9670
--- /dev/null
+++ b/dmake/tests/misc-4
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# 06.10.2005 Volker Quetschke
+# Test for parallel operation.
+# (no issue, sanity check only)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+file2="testfile"
+file3="testfile1"
+file4="testfile2"
+file5="testfile3"
+tmpfiles="$file1 $file2 $file3 $file4 $file5"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing parallel execution
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+testfile : testfile2 testfile3 testfile1
+ +@echo xx > \$@
+
+testfile1 :
+ +@echo making \$@ 1>&2
+ +@sleep 1
+ +@echo -n t1
+ +@echo 1 > \$@
+
+testfile2 :
+ +@echo making \$@ 1>&2
+ +@sleep 2
+ +@echo -n t2
+ +@echo 2 > \$@
+
+testfile3 :
+ +@echo making \$@ 1>&2
+ +@sleep 3
+ +@echo -n t3
+ +@echo 3 > \$@
+
+EOT
+
+output=$(${DMAKEPROG} -r -P3 -f $file1)
+result=$?
+
+# In parallel operation the targets with the smaller sleep value
+# will finish first.
+if test "$output" != "t1t2t3"; 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