- Enhance .POSIX to set -e when invoking shells, as demanded by a
[make.git] / tests / scripts / variables / MAKECMDGOALS
blob879283b056714f52e1e0aa6e8a7e9442dbc52f04
1 #                                                                    -*-perl-*-
3 $description = "Test the MAKECMDGOALS variable.";
5 $details = "\
6 We construct a makefile with various targets, all of which print out
7 \$(MAKECMDGOALS), then call it different ways.";
9 open(MAKEFILE,"> $makefile");
10 print MAKEFILE "\
11 .DEFAULT all:
12         \@echo \$(MAKECMDGOALS)
14 close(MAKEFILE);
16 # TEST #1
18 &run_make_with_options($makefile,
19                        "",
20                        &get_logfile,
21                        0);
22 $answer = "\n";
23 &compare_output($answer,&get_logfile(1));
25 # TEST #2
27 &run_make_with_options($makefile,
28                        "all",
29                        &get_logfile,
30                        0);
31 $answer = "all\n";
32 &compare_output($answer,&get_logfile(1));
35 # TEST #3
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));
45 # This tells the test driver that the perl test script executed properly.