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