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