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; |