]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Added test for checking that subdirectories are processed first
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 17 Apr 2008 06:29:00 +0000 (06:29 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 17 Apr 2008 06:29:00 +0000 (06:29 +0000)
darcs-hash:20080417062949-f2ef6-2539acae31fc7b94c2abf72039475b3987f50639.gz

tests/subdirs-first/Makefile [new file with mode: 0644]
tests/subdirs-first/Makefile.omk [new file with mode: 0644]
tests/subdirs-first/order-correct.txt [new file with mode: 0644]
tests/subdirs-first/runtest [new file with mode: 0755]
tests/subdirs-first/subdir/Makefile [new file with mode: 0644]
tests/subdirs-first/subdir/Makefile.omk [new file with mode: 0644]

diff --git a/tests/subdirs-first/Makefile b/tests/subdirs-first/Makefile
new file mode 100644 (file)
index 0000000..b22a357
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/tests/subdirs-first/Makefile.omk b/tests/subdirs-first/Makefile.omk
new file mode 100644 (file)
index 0000000..db2402c
--- /dev/null
@@ -0,0 +1,6 @@
+SUBDIRS=subdir
+
+default-config-pass-local: mycheck
+
+mycheck:
+       echo "In TOP directory"
diff --git a/tests/subdirs-first/order-correct.txt b/tests/subdirs-first/order-correct.txt
new file mode 100644 (file)
index 0000000..318b72d
--- /dev/null
@@ -0,0 +1,2 @@
+In SUBDIR directory
+In TOP directory
diff --git a/tests/subdirs-first/runtest b/tests/subdirs-first/runtest
new file mode 100755 (executable)
index 0000000..48d6a89
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. ../functions.sh
+
+make default-config 2>&1 | tee make.log
+
+grep '^In .* directory$' make.log | tee order-current.txt
+diff -u order-current.txt order-correct.txt || error "Subdirectories are not processed first"
diff --git a/tests/subdirs-first/subdir/Makefile b/tests/subdirs-first/subdir/Makefile
new file mode 100644 (file)
index 0000000..b22a357
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/tests/subdirs-first/subdir/Makefile.omk b/tests/subdirs-first/subdir/Makefile.omk
new file mode 100644 (file)
index 0000000..4d9eecb
--- /dev/null
@@ -0,0 +1,4 @@
+default-config-pass-local: mycheck
+
+mycheck:
+       echo "In SUBDIR directory"