VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/features/escape@ 947

Last change on this file since 947 was 503, checked in by bird, 18 years ago

Untested merge with GNU Make v3.81 (vendor/gnumake/2005-05-16 -> vendor/gnumake/current).

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
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;
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette