make/tests/scripts/features/recursion
Paul Smith c90f47e832 Flush stdout after printing directory info.
Fix references to MINGW #define constants.
Remove WINDOWS32 ifdef from sub_proc.h.
Only add variables to the command line for recursion once.
New features in run_make_test: #PWD# and #MAKEPATH# replacements.
Test the multi-variable fix in the recursion regression test.
2005-02-10 00:10:57 +00:00

55 lines
1.3 KiB
Perl

# -*-perl-*-
$description = "Test recursion.";
$details = "DETAILS";
# Test some basic recursion.
run_make_test('
all:
$(MAKE) -f #MAKEFILE# foo
foo:
@echo $(MAKE)
@echo MAKELEVEL = $(MAKELEVEL)
$(MAKE) -f #MAKEFILE# last
last:
@echo $(MAKE)
@echo MAKELEVEL = $(MAKELEVEL)
@echo THE END
',
('CFLAGS=-O -w' . ($parallel_jobs ? '-j 2' : '')),
($vos
? "#MAKE#: Entering directory `#PWD#'
make 'CFLAGS=-O' -f #MAKEFILE# foo
make CFLAGS=-O
MAKELEVEL = 0
make 'CFLAGS=-O' -f #MAKEFILE# last
make CFLAGS=-O
MAKELEVEL = 0
THE END
#MAKE#: Leaving directory `#PWD#'"
: "#MAKE#: Entering directory `#PWD#'
#MAKEPATH# -f #MAKEFILE# foo
#MAKE#[1]: Entering directory `#PWD#'
#MAKEPATH#
MAKELEVEL = 1
#MAKEPATH# -f #MAKEFILE# last
#MAKE#[2]: Entering directory `#PWD#'
#MAKEPATH#
MAKELEVEL = 2
THE END
#MAKE#[2]: Leaving directory `#PWD#'
#MAKE#[1]: Leaving directory `#PWD#'
#MAKE#: Leaving directory `#PWD#'"));
# Test command line overrides.
run_make_test('
recur: all ; @$(MAKE) --no-print-directory -f #MAKEFILE# a=AA all
all: ; @echo "MAKEOVERRIDES = $(MAKEOVERRIDES)"
',
'a=ZZ',
'MAKEOVERRIDES = a=ZZ
MAKEOVERRIDES = a=AA
');
1;