/[make]/make/tests/scripts/functions/if
ViewVC logotype

Contents of /make/tests/scripts/functions/if

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Nov 4 07:40:29 2003 UTC (20 years, 6 months ago) by psmith
Branch: MAIN
CVS Tags: make-3-82, make-3-81, moved-to-git, HEAD
Changes since 1.2: +13 -11 lines
Fix bugs 5798 and 6195.

1 # -*-perl-*-
2 $description = "Test the if function.\n";
3
4 $details = "Try various uses of if and ensure they all give the correct
5 results.\n";
6
7 open(MAKEFILE, "> $makefile");
8
9 print MAKEFILE <<EOMAKE;
10 NEQ = \$(subst \$1,,\$2)
11 e =
12
13 all:
14 \t\@echo 1 \$(if ,true,false)
15 \t\@echo 2 \$(if ,true,)
16 \t\@echo 3 \$(if ,true)
17 \t\@echo 4 \$(if z,true,false)
18 \t\@echo 5 \$(if z,true,\$(shell echo hi))
19 \t\@echo 6 \$(if ,\$(shell echo hi),false)
20 \t\@echo 7 \$(if \$(call NEQ,a,b),true,false)
21 \t\@echo 8 \$(if \$(call NEQ,a,a),true,false)
22 \t\@echo 9 \$(if z,true,fal,se) hi
23 \t\@echo 10 \$(if ,true,fal,se)there
24 \t\@echo 11 \$(if \$(e) ,true,false)
25 EOMAKE
26
27 close(MAKEFILE);
28
29 &run_make_with_options($makefile, "", &get_logfile);
30 $answer = "1 false\n2\n3\n4 true\n5 true\n6 false\n7 true\n8 false\n9 true hi\n10 fal,sethere\n11 false\n";
31 &compare_output($answer, &get_logfile(1));
32
33 1;

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26