make/tests/scripts/options/dash-r
Paul Smith 1bc35a7ae7 tests: Allow run_make_test() to avoid passing -f
We already use undef makefile strings to mean "re-use the previous
makefile", so if the string is empty we'll assume it means "don't
use a makefile at all" (don't add -f).

* tests/run_make_tests.pl (run_make_test): If the makefile string
is empty, don't create a makefile or add -f.
* tests/scripts/features/include: Change empty makefile to "\n".
* tests/scripts/misc/close_stdout: Ditto.
* tests/scripts/options/dash-r: Ditto.
2022-02-27 17:47:42 -05:00

37 lines
790 B
Perl

# -*-perl-*-
$description = "Test removing default rules and variables";
$details = "DETAILS";
touch('xxx.c');
# Simple check
run_make_test("\n", '-r COMPILE.c=echo xxx.o',
"#MAKE#: *** No rule to make target 'xxx.o'. Stop.", 512);
# Make sure we can set it from within the makefile too
run_make_test(q!
COMPILE.c = echo
MAKEFLAGS += -r
!,
'xxx.o',
"#MAKE#: *** No rule to make target 'xxx.o'. Stop.", 512);
unlink('xxx.c');
# Simple check for -R
run_make_test(q!
all:;$(info CC='$(CC)')
!,
'-sR', "CC=''");
# Make sure we can set -R from within the makefile too
run_make_test(q!
MAKEFLAGS += -R
all:;$(info CC='$(CC)')
!,
'-s', "CC=''");
1;