summaryrefslogtreecommitdiff
path: root/tests/scripts/misc/general3
blob: 40b7ed93ac9c437396cac5de6f22ef2e4bbdace1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#                                                                    -*-perl-*-

$description = "\
This tests random features of the parser that need to be supported, and
which have either broken at some point in the past or seem likely to
break.";

run_make_test("
# We want to allow both empty commands _and_ commands that resolve to empty.
EMPTY =

.PHONY: all a1 a2 a3 a4
all: a1 a2 a3 a4

a1:;
a2:
\t
a3:;\$(EMPTY)
a4:
\t\$(EMPTY)

\# Non-empty lines that expand to nothing should also be ignored.
STR =     \# Some spaces
TAB =   \t  \# A TAB and some spaces

\$(STR)

\$(STR) \$(TAB)",
              '', "#MAKE#: Nothing to be done for `all'.");

# TEST 2

# Make sure files without trailing newlines are handled properly.
# Have to use the old style invocation to test this.

$makefile2 = &get_tmpfile;

open(MAKEFILE, "> $makefile2");
print MAKEFILE "all:;\@echo FOO = \$(FOO)\nFOO = foo";
close(MAKEFILE);

&run_make_with_options($makefile2,"",&get_logfile);
$answer = "FOO = foo\n";
&compare_output($answer,&get_logfile(1));

# TEST 3

# Check semicolons in variable references

run_make_test('
$(if true,$(info true; true))
all: ; @:
',
              '', 'true; true');

1;