Bump for 3.6-28
[LibreOffice.git] / sal / test / bootstrap.pl
blob5f697e8b02cf1ef39c6ca17d984f7bb4ffb059db
2 eval 'exec perl -wS $0 ${1+"$@"}'
3 if 0;
4 #*************************************************************************
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 # Copyright 2000, 2010 Oracle and/or its affiliates.
10 # OpenOffice.org - a multi-platform office productivity suite
12 # This file is part of OpenOffice.org.
14 # OpenOffice.org is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU Lesser General Public License version 3
16 # only, as published by the Free Software Foundation.
18 # OpenOffice.org is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU Lesser General Public License version 3 for more details
22 # (a copy is included in the LICENSE file that accompanied this code).
24 # You should have received a copy of the GNU Lesser General Public License
25 # version 3 along with OpenOffice.org. If not, see
26 # <http://www.openoffice.org/license.html>
27 # for a copy of the LGPLv3 License.
29 #*************************************************************************
32 my $rc;
33 my $state = 1;
34 my $comment = "";
36 $ENV{MYBOOTSTRAPTESTVALUE}=0;
38 $rc = system "./testbootstrap", 1, "-env:MYBOOTSTRAPTESTVALUE=1";
39 if (!$rc) {
40 $comment = $comment . "commandline over environment test not passed\n";
41 $state = 0;
44 $rc = system "./testbootstrap", "0", "-env:INIFILENAME=";
45 if (!$rc) {
46 $comment = $comment . "exe custom ini test not passed\n";
47 $state = 0;
50 delete $ENV{MYBOOTSTRAPTESTVALUE};
52 $rc = system "./testbootstrap.bin", "file";
53 if (!$rc) {
54 $comment = $comment . "extensions cut test not passed with .bin\n";
55 $state = 0;
58 $rc = system "./testbootstrap.Bin", "file";
59 if (!$rc) {
60 $comment = $comment . "extensions cut test not passed with .Bin\n";
61 $state = 0;
64 $rc = system "./testbootstrap.exe", "file";
65 if (!$rc) {
66 $comment = $comment . "extensions cut test not passed with .exe\n";
67 $state = 0;
70 $rc = system "./testbootstrap.Exe", "file";
71 if (!$rc) {
72 $comment = $comment . "extensions cut test not passed with .Exe\n";
73 $state = 0;
76 if ($ENV{GUI} eq "WNT") {
77 $rc = system "./testbootstrap", "auxaux", "-env:iniName=ini.ini", '-env:MYBOOTSTRAPTESTVALUE=$CUSTOMINIVALUE';
79 else {
80 $rc = system "./testbootstrap", "auxaux", "-env:iniName=inirc", '-env:MYBOOTSTRAPTESTVALUE=$CUSTOMINIVALUE';
82 if (!$rc) {
83 $comment = $comment . "custom ini test not passed\n";
84 $state = 0;
87 if ($ENV{GUI} eq "WNT") {
88 $comment = $comment . '$SYSUSERHOME not testable under windows' . "\n";
90 else {
91 $rc = system "./testbootstrap", "file://$ENV{HOME}", '-env:MYBOOTSTRAPTESTVALUE=$SYSUSERHOME';
92 if (!$rc) {
93 $comment = $comment . '$SYSUSERHOME test not passed' . "\n";
94 $state = 0;
98 if ($ENV{GUI} eq "WNT") {
99 $comment = $comment . '$SYSUSERCONFIG' . " not testable under windows\n";
101 else {
102 $rc = system "./testbootstrap", "file://$ENV{HOME}", '-env:MYBOOTSTRAPTESTVALUE=$SYSUSERCONFIG';
103 if (!$rc) {
104 $comment = $comment . '$SYSUSERCONFIG test not passed' . "\n";
105 $state = 0;
109 if ($ENV{GUI} eq "WNT") {
110 $comment = $comment . '$SYSBINDIR' . " not testable under windows\n";
112 else {
113 $rc = system "./testbootstrap", "file://$ENV{PWD}", '-env:MYBOOTSTRAPTESTVALUE=$SYSBINDIR';
114 if (!$rc) {
115 $comment = $comment . '$SYSBINDIR test not passed' . "\n";
116 $state = 0;
120 if ($ENV{GUI} eq "WNT") {
121 $rc = system "./testbootstrap", "inherited_value", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_VALUE', "-env:iniName=ini.ini";
123 else {
124 $rc = system "./testbootstrap", "inherited_value", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_VALUE', "-env:iniName=inirc";
126 if (!$rc) {
127 $comment = $comment . "inherited value not passed\n";
128 $state = 0;
131 if ($ENV{GUI} eq "WNT") {
132 $rc = system "./testbootstrap", "not_overwritten", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_OVERWRITTEN_VALUE', "-env:iniName=ini.ini";
134 else {
135 $rc = system "./testbootstrap", "not_overwritten", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_OVERWRITTEN_VALUE', "-env:iniName=inirc";
137 if (!$rc) {
138 $comment = $comment . "inherited overwritten value not passed\n";
139 $state = 0;
143 $rc = system "./testbootstrap", "defaultvalue", "-env:INIFILENAME=", "-env:Default=defaultvalue", "-env:USEDEFAULT=1";
144 if (!$rc) {
145 $comment = $comment . "default test from parameter not passed\n";
146 $state = 0;
149 if ($ENV{GUI} eq "WNT") {
150 $rc = system "./testbootstrap", "defaultValue", "-env:iniName=default.ini", "-env:INIFILENAME=", "-env:USEDEFAULT=1";
152 else {
153 $rc = system "./testbootstrap", "defaultValue", "-env:iniName=defaultrc", "-env:INIFILENAME=", "-env:USEDEFAULT=1";
155 if (!$rc) {
156 $comment = $comment . "default test from custom ini not passed\n";
157 $state = 0;
160 # simple macro expansion
161 $rc = system "./testbootstrap",
162 "_first_second_third_",
163 "-env:FIRST=first",
164 "-env:SECOND=second",
165 "-env:THIRD=third",
166 '-env:MYBOOTSTRAPTESTVALUE=_${FIRST}_${SECOND}_${THIRD}_';
167 if (!$rc) {
168 $comment = $comment . "simple macro expansion test not passed\n";
169 $state = 0;
172 # simple quoting
173 $rc = system "./testbootstrap",
174 '_${FIRST}_${SECOND}_${THIRD}_',
175 "-env:FIRST=first",
176 "-env:SECOND=second",
177 "-env:THIRD=third",
178 '-env:MYBOOTSTRAPTESTVALUE=_\$\{FIRST\}_\$\{SECOND\}_\$\{THIRD\}_';
179 if (!$rc) {
180 $comment = $comment . "simple macro quoting test not passed\n";
181 $state = 0;
184 # simple ini access
185 $rc = system "./testbootstrap",
186 "TheIniKeysValue",
187 '-env:MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheIniKey}';
188 if (!$rc) {
189 $comment = $comment . "simple macro ini access test not passed\n";
190 $state = 0;
193 # simple profile access
194 $rc = system "./testbootstrap",
195 "TheKeysValue",
196 '-env:MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheSection:TheKey}';
197 if (!$rc) {
198 $comment = $comment . "simple macro profile access test not passed\n";
199 $state = 0;
202 # profile access with simple macro expansion
203 $rc = system "./testbootstrap",
204 "TheKeysValue",
205 "-env:ININAME=./bootstraptest.ini",
206 "-env:SECTIONNAME=TheSection",
207 "-env:KEYNAME=TheKey",
208 '-env:MYBOOTSTRAPTESTVALUE=${$ININAME:$SECTIONNAME:$KEYNAME}';
209 if (!$rc) {
210 $comment = $comment . "profile access with simple macro expansion test not passed\n";
211 $state = 0;
214 # profile access with complex macro expansion
215 $rc = system "./testbootstrap",
216 "TheKeysValue",
217 "-env:ININAME=./bootstraptest.ini",
218 '-env:MYBOOTSTRAPTESTVALUE=${$ININAME:${$ININAME:SecondSection:IndirectSection}:${$ININAME:SecondSection:IndirectKey}}';
219 if (!$rc) {
220 $comment = $comment . "profile access with complex macro expansion test not passed\n";
221 $state = 0;
224 # test no infinit recursion
225 if ($ENV{GUI} eq "WNT") {
226 $rc = system "./testbootstrap",
227 '"***RECURSION DETECTED***"',
228 '-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
230 else {
231 $rc = system "./testbootstrap",
232 '***RECURSION DETECTED***',
233 '-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
235 if (!$rc) {
236 $comment = $comment . "no infinit recursion test not passed\n";
237 $state = 0;
240 # test unicode
241 $rc = system "./testbootstrap",
242 "AAABBBCCC000",
243 '-env:MYBOOTSTRAPTESTVALUE=\u0041\u0041\u0041\u0042\u0042\u0042\u0043\u0043\u0043\u0030\u0030\u0030';
244 if (!$rc) {
245 $comment = $comment . "uncode not passed\n";
246 $state = 0;
249 print "**************************\n";
250 if($state) {
251 print "****** tests passed ******\n";
253 else {
254 print "**** tests NOT passed ****\n";
255 print "Commnent:\n", $comment, "\n";
257 print "**************************\n";