2 eval 'exec perl -wS $0 ${1+"$@"}'
4 #*************************************************************************
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 # Copyright 2008 by Sun Microsystems, Inc.
10 # OpenOffice.org - a multi-platform office productivity suite
12 # $RCSfile: bootstrap.pl,v $
16 # This file is part of OpenOffice.org.
18 # OpenOffice.org is free software: you can redistribute it and/or modify
19 # it under the terms of the GNU Lesser General Public License version 3
20 # only, as published by the Free Software Foundation.
22 # OpenOffice.org is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU Lesser General Public License version 3 for more details
26 # (a copy is included in the LICENSE file that accompanied this code).
28 # You should have received a copy of the GNU Lesser General Public License
29 # version 3 along with OpenOffice.org. If not, see
30 # <http://www.openoffice.org/license.html>
31 # for a copy of the LGPLv3 License.
33 #*************************************************************************
40 $ENV{MYBOOTSTRAPTESTVALUE
}=0;
42 $rc = system "./testbootstrap", 1, "-env:MYBOOTSTRAPTESTVALUE=1";
44 $comment = $comment . "commandline over environment test not passed\n";
48 $rc = system "./testbootstrap", "0", "-env:INIFILENAME=";
50 $comment = $comment . "exe custom ini test not passed\n";
54 delete $ENV{MYBOOTSTRAPTESTVALUE
};
56 $rc = system "./testbootstrap.bin", "file";
58 $comment = $comment . "extensions cut test not passed with .bin\n";
62 $rc = system "./testbootstrap.Bin", "file";
64 $comment = $comment . "extensions cut test not passed with .Bin\n";
68 $rc = system "./testbootstrap.exe", "file";
70 $comment = $comment . "extensions cut test not passed with .exe\n";
74 $rc = system "./testbootstrap.Exe", "file";
76 $comment = $comment . "extensions cut test not passed with .Exe\n";
80 if ($ENV{GUI
} eq "WNT") {
81 $rc = system "./testbootstrap", "auxaux", "-env:iniName=ini.ini", '-env:MYBOOTSTRAPTESTVALUE=$CUSTOMINIVALUE';
84 $rc = system "./testbootstrap", "auxaux", "-env:iniName=inirc", '-env:MYBOOTSTRAPTESTVALUE=$CUSTOMINIVALUE';
87 $comment = $comment . "custom ini test not passed\n";
91 if ($ENV{GUI
} eq "WNT") {
92 $comment = $comment . '$SYSUSERHOME not testable under windows' . "\n";
95 $rc = system "./testbootstrap", "file://$ENV{HOME}", '-env:MYBOOTSTRAPTESTVALUE=$SYSUSERHOME';
97 $comment = $comment . '$SYSUSERHOME test not passed' . "\n";
102 if ($ENV{GUI
} eq "WNT") {
103 $comment = $comment . '$SYSUSERCONFIG' . " not testable under windows\n";
106 $rc = system "./testbootstrap", "file://$ENV{HOME}", '-env:MYBOOTSTRAPTESTVALUE=$SYSUSERCONFIG';
108 $comment = $comment . '$SYSUSERCONFIG test not passed' . "\n";
113 if ($ENV{GUI
} eq "WNT") {
114 $comment = $comment . '$SYSBINDIR' . " not testable under windows\n";
117 $rc = system "./testbootstrap", "file://$ENV{PWD}", '-env:MYBOOTSTRAPTESTVALUE=$SYSBINDIR';
119 $comment = $comment . '$SYSBINDIR test not passed' . "\n";
124 if ($ENV{GUI
} eq "WNT") {
125 $rc = system "./testbootstrap", "inherited_value", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_VALUE', "-env:iniName=ini.ini";
128 $rc = system "./testbootstrap", "inherited_value", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_VALUE', "-env:iniName=inirc";
131 $comment = $comment . "inherited value not passed\n";
135 if ($ENV{GUI
} eq "WNT") {
136 $rc = system "./testbootstrap", "not_overwritten", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_OVERWRITTEN_VALUE', "-env:iniName=ini.ini";
139 $rc = system "./testbootstrap", "not_overwritten", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_OVERWRITTEN_VALUE', "-env:iniName=inirc";
142 $comment = $comment . "inherited overwritten value not passed\n";
147 $rc = system "./testbootstrap", "defaultvalue", "-env:INIFILENAME=", "-env:Default=defaultvalue", "-env:USEDEFAULT=1";
149 $comment = $comment . "default test from parameter not passed\n";
153 if ($ENV{GUI
} eq "WNT") {
154 $rc = system "./testbootstrap", "defaultValue", "-env:iniName=default.ini", "-env:INIFILENAME=", "-env:USEDEFAULT=1";
157 $rc = system "./testbootstrap", "defaultValue", "-env:iniName=defaultrc", "-env:INIFILENAME=", "-env:USEDEFAULT=1";
160 $comment = $comment . "default test from custom ini not passed\n";
164 # simple macro expansion
165 $rc = system "./testbootstrap",
166 "_first_second_third_",
168 "-env:SECOND=second",
170 '-env:MYBOOTSTRAPTESTVALUE=_${FIRST}_${SECOND}_${THIRD}_';
172 $comment = $comment . "simple macro expansion test not passed\n";
177 $rc = system "./testbootstrap",
178 '_${FIRST}_${SECOND}_${THIRD}_',
180 "-env:SECOND=second",
182 '-env:MYBOOTSTRAPTESTVALUE=_\$\{FIRST\}_\$\{SECOND\}_\$\{THIRD\}_';
184 $comment = $comment . "simple macro quoting test not passed\n";
189 $rc = system "./testbootstrap",
191 '-env:MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheIniKey}';
193 $comment = $comment . "simple macro ini access test not passed\n";
197 # simple profile access
198 $rc = system "./testbootstrap",
200 '-env:MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheSection:TheKey}';
202 $comment = $comment . "simple macro profile access test not passed\n";
206 # profile access with simple macro expansion
207 $rc = system "./testbootstrap",
209 "-env:ININAME=./bootstraptest.ini",
210 "-env:SECTIONNAME=TheSection",
211 "-env:KEYNAME=TheKey",
212 '-env:MYBOOTSTRAPTESTVALUE=${$ININAME:$SECTIONNAME:$KEYNAME}';
214 $comment = $comment . "profile access with simple macro expansion test not passed\n";
218 # profile access with complex macro expansion
219 $rc = system "./testbootstrap",
221 "-env:ININAME=./bootstraptest.ini",
222 '-env:MYBOOTSTRAPTESTVALUE=${$ININAME:${$ININAME:SecondSection:IndirectSection}:${$ININAME:SecondSection:IndirectKey}}';
224 $comment = $comment . "profile access with complex macro expansion test not passed\n";
228 # test no infinit recursion
229 if ($ENV{GUI
} eq "WNT") {
230 $rc = system "./testbootstrap",
231 '"***RECURSION DETECTED***"',
232 '-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
235 $rc = system "./testbootstrap",
236 '***RECURSION DETECTED***',
237 '-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
240 $comment = $comment . "no infinit recursion test not passed\n";
245 $rc = system "./testbootstrap",
247 '-env:MYBOOTSTRAPTESTVALUE=\u0041\u0041\u0041\u0042\u0042\u0042\u0043\u0043\u0043\u0030\u0030\u0030';
249 $comment = $comment . "uncode not passed\n";
253 print "**************************\n";
255 print "****** tests passed ******\n";
258 print "**** tests NOT passed ****\n";
259 print "Commnent:\n", $comment, "\n";
261 print "**************************\n";