mirror of
https://github.com/mirror/make.git
synced 2025-01-22 18:20:50 +08:00
6c1a6dd77c
* src/read.c (eval): If "missing separator" appears to be due to missing space after ifeq/ifneq, give a hint about the error. * tests/scripts/misc/failure: Check for these types of failures. * tests/scripts/variables/special: Move error checking unrelated to special variables, to misc/failure.
50 lines
1.0 KiB
Perl
50 lines
1.0 KiB
Perl
# -*-perl-*-
|
|
|
|
$description = "Test miscellaneous failures.";
|
|
|
|
|
|
# Test that the "did you mean TAB" message is printed properly
|
|
|
|
run_make_test(q!
|
|
$x.
|
|
!,
|
|
'', '#MAKEFILE#:2: *** missing separator. Stop.', 512);
|
|
|
|
run_make_test(q!
|
|
foo:
|
|
bar
|
|
!,
|
|
'', '#MAKEFILE#:3: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.', 512);
|
|
|
|
run_make_test(q!
|
|
.RECIPEPREFIX = :
|
|
foo:
|
|
bar
|
|
!,
|
|
'', '#MAKEFILE#:4: *** missing separator. Stop.', 512);
|
|
|
|
for my $kw ('eq', 'neq') {
|
|
run_make_test(qq!
|
|
if$kw(foo,bar)
|
|
\$(error ouch)
|
|
endif
|
|
!,
|
|
'', '#MAKEFILE#:2: *** missing separator (ifeq/ifneq must be followed by whitespace). Stop.', 512);
|
|
|
|
run_make_test(qq!
|
|
if$kw
|
|
\$(error ouch)
|
|
endif
|
|
!,
|
|
'', '#MAKEFILE#:2: *** invalid syntax in conditional. Stop.', 512);
|
|
|
|
run_make_test(qq!
|
|
if$kw blah
|
|
\$(error ouch)
|
|
endif
|
|
!,
|
|
'', '#MAKEFILE#:2: *** invalid syntax in conditional. Stop.', 512);
|
|
}
|
|
|
|
1;
|