VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/functions/error@ 3140

Last change on this file since 3140 was 3140, checked in by bird, 7 years ago

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

  • Property svn:eol-style set to LF
File size: 1.6 KB
Line 
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:
Note: See TracBrowser for help on using the repository browser.

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