VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/functions/error@ 3208

最後變更 在這個檔案從3208是 3138,由 bird 提交於 7 年 前

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

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

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