From 564bf2ade2b158501b0780e067b0ca74e5ea0207 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 17 Apr 2008 06:29:00 +0000 Subject: [PATCH] Added test for checking that subdirectories are processed first darcs-hash:20080417062949-f2ef6-2539acae31fc7b94c2abf72039475b3987f50639.gz --- tests/subdirs-first/Makefile | 14 ++++++++++++++ tests/subdirs-first/Makefile.omk | 6 ++++++ tests/subdirs-first/order-correct.txt | 2 ++ tests/subdirs-first/runtest | 8 ++++++++ tests/subdirs-first/subdir/Makefile | 14 ++++++++++++++ tests/subdirs-first/subdir/Makefile.omk | 4 ++++ 6 files changed, 48 insertions(+) create mode 100644 tests/subdirs-first/Makefile create mode 100644 tests/subdirs-first/Makefile.omk create mode 100644 tests/subdirs-first/order-correct.txt create mode 100755 tests/subdirs-first/runtest create mode 100644 tests/subdirs-first/subdir/Makefile create mode 100644 tests/subdirs-first/subdir/Makefile.omk diff --git a/tests/subdirs-first/Makefile b/tests/subdirs-first/Makefile new file mode 100644 index 0000000..b22a357 --- /dev/null +++ b/tests/subdirs-first/Makefile @@ -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 index 0000000..db2402c --- /dev/null +++ b/tests/subdirs-first/Makefile.omk @@ -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 index 0000000..318b72d --- /dev/null +++ b/tests/subdirs-first/order-correct.txt @@ -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 index 0000000..48d6a89 --- /dev/null +++ b/tests/subdirs-first/runtest @@ -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 index 0000000..b22a357 --- /dev/null +++ b/tests/subdirs-first/subdir/Makefile @@ -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 index 0000000..4d9eecb --- /dev/null +++ b/tests/subdirs-first/subdir/Makefile.omk @@ -0,0 +1,4 @@ +default-config-pass-local: mycheck + +mycheck: + echo "In SUBDIR directory" -- 2.39.2