Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.
[make.git] / tests / scripts / features / escape
blob36bab182fb7e6e6e3d4feb53ad98817f78df49dc
1 #                                                                    -*-perl-*-
2 $description = "Test various types of escaping in makefiles.";
4 $details = "\
5 Make sure that escaping of ':' works in target names.
6 Make sure escaping of whitespace works in target names.
7 Make sure that escaping of '#' works.";
10 close(MAKEFILE);
13 # TEST 1
15 run_make_test('
16 $(path)foo : ; @echo "touch ($@)"
18 foo\ bar: ; @echo "touch ($@)"
20 sharp: foo\#bar.ext
21 foo\#bar.ext: ; @echo "foo#bar.ext = ($@)"',
22               '',
23               'touch (foo)');
25 # TEST 2: This one should fail, since the ":" is unquoted.
27 run_make_test(undef,
28               'path=pre:',
29               "#MAKEFILE#:2: *** target pattern contains no '%'.  Stop.",
30               512);
32 # TEST 3: This one should work, since we escape the ":".
34 run_make_test(undef,
35               "'path=pre\\:'",
36               'touch (pre:foo)');
38 # TEST 4: This one should fail, since the escape char is escaped.
40 run_make_test(undef,
41               "'path=pre\\\\:'",
42               "#MAKEFILE#:2: *** target pattern contains no '%'.  Stop.",
43               512);
45 # TEST 5: This one should work
47 run_make_test(undef,
48               "'foo bar'",
49               'touch (foo bar)');
51 # TEST 6: Test escaped comments
53 run_make_test(undef,
54               'sharp',
55               'foo#bar.ext = (foo#bar.ext)');
57 # This tells the test driver that the perl test script executed properly.