VirtualBox

source: kBuild/trunk/src/gmake/tests/scripts/features/statipattrules@ 285

Last change on this file since 285 was 285, checked in by bird, 19 years ago

This commit was generated by cvs2svn to compensate for changes in r284,
which included commits to RCS files with non-trunk default branches.

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1# -*-perl-*-
2$description = "Test handling of static pattern rules.";
3
4$details = "\
5The makefile created in this test has three targets. The
6filter command is used to get those target names ending in
7.o and statically creates a compile command with the target
8name and the target name with .c. It also does the same thing
9for another target filtered with .elc and creates a command
10to emacs a .el file";
11
12open(MAKEFILE,"> $makefile");
13print MAKEFILE <<'EOF';
14files = foo.elc bar.o lose.o
15
16$(filter %.o,$(files)): %.o: %.c ; @echo CC -c $(CFLAGS) $< -o $@
17
18$(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $<
19EOF
20close(MAKEFILE);
21
22
23&touch('bar.c', 'lose.c');
24
25# TEST #1
26# -------
27
28&run_make_with_options($makefile, '', &get_logfile);
29$answer = "CC -c bar.c -o bar.o\n";
30&compare_output($answer, &get_logfile(1));
31
32
33# TEST #2
34# -------
35
36&run_make_with_options($makefile, 'lose.o', &get_logfile);
37$answer = "CC -c lose.c -o lose.o\n";
38&compare_output($answer, &get_logfile(1));
39
40
41# TEST #3
42# -------
43&touch("foo.el");
44
45&run_make_with_options($makefile, 'foo.elc', &get_logfile);
46$answer = "emacs foo.el\n";
47&compare_output($answer, &get_logfile(1));
48
49
50unlink('foo.el', 'bar.c', 'lose.c');
51
52
53# TEST #4 -- PR/1670: don't core dump on invalid static pattern rules
54# -------
55
56$makefile2 = &get_tmpfile;
57open(MAKEFILE, "> $makefile2");
58print MAKEFILE "foo: foo%: % ; \@echo \$@\n";
59close(MAKEFILE);
60
61&run_make_with_options($makefile2, '', &get_logfile);
62$answer = "foo\n";
63&compare_output($answer, &get_logfile(1));
64
65# TEST #5 -- bug #12180: core dump on a stat pattern rule with an empty
66# prerequisite list.
67#
68run_make_test('
69foo.x bar.x: %.x : ; @echo $@
70
71',
72'',
73'foo.x
74');
75
761;
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