VirtualBox

source: kBuild/trunk/src/gmake/tests/scripts/functions/error@ 285

最後變更 在這個檔案從285是 53,由 bird 提交於 21 年 前

Initial revision

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.3 KB
 
1$description = "\
2The following test creates a makefile to test the error function.";
3
4$details = "";
5
6open(MAKEFILE,"> $makefile");
7
8print MAKEFILE <<'EOF';
9ifdef ERROR1
10$(error error is $(ERROR1))
11endif
12
13ifdef ERROR2
14$(error error is $(ERROR2))
15endif
16
17ifdef ERROR3
18all: some; @echo $(error error is $(ERROR3))
19endif
20
21ifdef ERROR4
22all: some; @echo error is $(ERROR4)
23 @echo $(error error is $(ERROR4))
24endif
25
26some: ; @echo Some stuff
27
28EOF
29
30close(MAKEFILE);
31
32# Test #1
33
34&run_make_with_options($makefile, "ERROR1=yes", &get_logfile, 512);
35$answer = "$makefile:2: *** error is yes. Stop.\n";
36&compare_output($answer,&get_logfile(1));
37
38# Test #2
39
40&run_make_with_options($makefile, "ERROR2=no", &get_logfile, 512);
41$answer = "$makefile:6: *** error is no. Stop.\n";
42&compare_output($answer,&get_logfile(1));
43
44# Test #3
45
46&run_make_with_options($makefile, "ERROR3=maybe", &get_logfile, 512);
47$answer = "Some stuff\n$makefile:10: *** error is maybe. Stop.\n";
48&compare_output($answer,&get_logfile(1));
49
50# Test #4
51
52&run_make_with_options($makefile, "ERROR4=definitely", &get_logfile, 512);
53$answer = "Some stuff\n$makefile:14: *** error is definitely. Stop.\n";
54&compare_output($answer,&get_logfile(1));
55
56# This tells the test driver that the perl test script executed properly.
571;
58
59
60
61
62
63
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette