1#                                                                    -*-perl-*-
2$description = "Test various types of escaping in makefiles.";
3
4$details = "\
5Make sure that escaping of `:' works in target names.
6Make sure escaping of whitespace works in target names.
7Make sure that escaping of '#' works.";
8
9
10close(MAKEFILE);
11
12
13# TEST 1
14
15run_make_test('
16$(path)foo : ; @echo "touch ($@)"
17
18foo\ bar: ; @echo "touch ($@)"
19
20sharp: foo\#bar.ext
21foo\#bar.ext: ; @echo "foo#bar.ext = ($@)"',
22	      '',
23	      'touch (foo)');
24
25# TEST 2: This one should fail, since the ":" is unquoted.
26
27run_make_test(undef,
28	      'path=pre:',
29	      "#MAKEFILE#:2: *** target pattern contains no `%'.  Stop.",
30	      512);
31
32# TEST 3: This one should work, since we escape the ":".
33
34run_make_test(undef,
35	      "'path=pre\\:'",
36	      'touch (pre:foo)');
37
38# TEST 4: This one should fail, since the escape char is escaped.
39
40run_make_test(undef,
41	      "'path=pre\\\\:'",
42	      "#MAKEFILE#:2: *** target pattern contains no `%'.  Stop.",
43	      512);
44
45# TEST 5: This one should work
46
47run_make_test(undef,
48	      "'foo bar'",
49	      'touch (foo bar)');
50
51# TEST 6: Test escaped comments
52
53run_make_test(undef,
54	      'sharp',
55	      'foo#bar.ext = (foo#bar.ext)');
56
57# This tells the test driver that the perl test script executed properly.
581;
59