| 1 |
# -*-perl-*- |
| 2 |
|
| 3 |
$description = "Test the MAKECMDGOALS variable."; |
| 4 |
|
| 5 |
$details = "\ |
| 6 |
We construct a makefile with various targets, all of which print out |
| 7 |
\$(MAKECMDGOALS), then call it different ways."; |
| 8 |
|
| 9 |
open(MAKEFILE,"> $makefile"); |
| 10 |
print MAKEFILE "\ |
| 11 |
.DEFAULT all: |
| 12 |
\@echo \$(MAKECMDGOALS) |
| 13 |
"; |
| 14 |
close(MAKEFILE); |
| 15 |
|
| 16 |
# TEST #1 |
| 17 |
|
| 18 |
&run_make_with_options($makefile, |
| 19 |
"", |
| 20 |
&get_logfile, |
| 21 |
0); |
| 22 |
$answer = "\n"; |
| 23 |
&compare_output($answer,&get_logfile(1)); |
| 24 |
|
| 25 |
# TEST #2 |
| 26 |
|
| 27 |
&run_make_with_options($makefile, |
| 28 |
"all", |
| 29 |
&get_logfile, |
| 30 |
0); |
| 31 |
$answer = "all\n"; |
| 32 |
&compare_output($answer,&get_logfile(1)); |
| 33 |
|
| 34 |
|
| 35 |
# TEST #3 |
| 36 |
|
| 37 |
&run_make_with_options($makefile, |
| 38 |
"foo bar baz yaz", |
| 39 |
&get_logfile, |
| 40 |
0); |
| 41 |
$answer = "foo bar baz yaz\nfoo bar baz yaz\nfoo bar baz yaz\nfoo bar baz yaz\n"; |
| 42 |
&compare_output($answer,&get_logfile(1)); |
| 43 |
|
| 44 |
|
| 45 |
# This tells the test driver that the perl test script executed properly. |
| 46 |
1; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|