2 eval 'exec perl -wS $0 ${1+"$@"}'
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 #*************************************************************************
36 $ENV{MYBOOTSTRAPTESTVALUE
}=0;
38 $rc = system "./testbootstrap", 1, "-env:MYBOOTSTRAPTESTVALUE=1";
40 $comment = $comment . "commandline over environment test not passed\n";
44 $rc = system "./testbootstrap", "0", "-env:INIFILENAME=";
46 $comment = $comment . "exe custom ini test not passed\n";
50 delete $ENV{MYBOOTSTRAPTESTVALUE
};
52 $rc = system "./testbootstrap.bin", "file";
54 $comment = $comment . "extensions cut test not passed with .bin\n";
58 $rc = system "./testbootstrap.Bin", "file";
60 $comment = $comment . "extensions cut test not passed with .Bin\n";
64 $rc = system "./testbootstrap.exe", "file";
66 $comment = $comment . "extensions cut test not passed with .exe\n";
70 $rc = system "./testbootstrap.Exe", "file";
72 $comment = $comment . "extensions cut test not passed with .Exe\n";
76 if ($ENV{GUI
} eq "WNT") {
77 $rc = system "./testbootstrap", "auxaux", "-env:iniName=ini.ini", '-env:MYBOOTSTRAPTESTVALUE=$CUSTOMINIVALUE';
80 $rc = system "./testbootstrap", "auxaux", "-env:iniName=inirc", '-env:MYBOOTSTRAPTESTVALUE=$CUSTOMINIVALUE';
83 $comment = $comment . "custom ini test not passed\n";
87 if ($ENV{GUI
} eq "WNT") {
88 $comment = $comment . '$SYSUSERHOME not testable under windows' . "\n";
91 $rc = system "./testbootstrap", "file://$ENV{HOME}", '-env:MYBOOTSTRAPTESTVALUE=$SYSUSERHOME';
93 $comment = $comment . '$SYSUSERHOME test not passed' . "\n";
98 if ($ENV{GUI
} eq "WNT") {
99 $comment = $comment . '$SYSUSERCONFIG' . " not testable under windows\n";
102 $rc = system "./testbootstrap", "file://$ENV{HOME}", '-env:MYBOOTSTRAPTESTVALUE=$SYSUSERCONFIG';
104 $comment = $comment . '$SYSUSERCONFIG test not passed' . "\n";
109 if ($ENV{GUI
} eq "WNT") {
110 $comment = $comment . '$SYSBINDIR' . " not testable under windows\n";
113 $rc = system "./testbootstrap", "file://$ENV{PWD}", '-env:MYBOOTSTRAPTESTVALUE=$SYSBINDIR';
115 $comment = $comment . '$SYSBINDIR test not passed' . "\n";
120 if ($ENV{GUI
} eq "WNT") {
121 $rc = system "./testbootstrap", "inherited_value", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_VALUE', "-env:iniName=ini.ini";
124 $rc = system "./testbootstrap", "inherited_value", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_VALUE', "-env:iniName=inirc";
127 $comment = $comment . "inherited value not passed\n";
131 if ($ENV{GUI
} eq "WNT") {
132 $rc = system "./testbootstrap", "not_overwritten", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_OVERWRITTEN_VALUE', "-env:iniName=ini.ini";
135 $rc = system "./testbootstrap", "not_overwritten", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_OVERWRITTEN_VALUE', "-env:iniName=inirc";
138 $comment = $comment . "inherited overwritten value not passed\n";
143 $rc = system "./testbootstrap", "defaultvalue", "-env:INIFILENAME=", "-env:Default=defaultvalue", "-env:USEDEFAULT=1";
145 $comment = $comment . "default test from parameter not passed\n";
149 if ($ENV{GUI
} eq "WNT") {
150 $rc = system "./testbootstrap", "defaultValue", "-env:iniName=default.ini", "-env:INIFILENAME=", "-env:USEDEFAULT=1";
153 $rc = system "./testbootstrap", "defaultValue", "-env:iniName=defaultrc", "-env:INIFILENAME=", "-env:USEDEFAULT=1";
156 $comment = $comment . "default test from custom ini not passed\n";
160 # simple macro expansion
161 $rc = system "./testbootstrap",
162 "_first_second_third_",
164 "-env:SECOND=second",
166 '-env:MYBOOTSTRAPTESTVALUE=_${FIRST}_${SECOND}_${THIRD}_';
168 $comment = $comment . "simple macro expansion test not passed\n";
173 $rc = system "./testbootstrap",
174 '_${FIRST}_${SECOND}_${THIRD}_',
176 "-env:SECOND=second",
178 '-env:MYBOOTSTRAPTESTVALUE=_\$\{FIRST\}_\$\{SECOND\}_\$\{THIRD\}_';
180 $comment = $comment . "simple macro quoting test not passed\n";
185 $rc = system "./testbootstrap",
187 '-env:MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheIniKey}';
189 $comment = $comment . "simple macro ini access test not passed\n";
193 # simple profile access
194 $rc = system "./testbootstrap",
196 '-env:MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheSection:TheKey}';
198 $comment = $comment . "simple macro profile access test not passed\n";
202 # profile access with simple macro expansion
203 $rc = system "./testbootstrap",
205 "-env:ININAME=./bootstraptest.ini",
206 "-env:SECTIONNAME=TheSection",
207 "-env:KEYNAME=TheKey",
208 '-env:MYBOOTSTRAPTESTVALUE=${$ININAME:$SECTIONNAME:$KEYNAME}';
210 $comment = $comment . "profile access with simple macro expansion test not passed\n";
214 # profile access with complex macro expansion
215 $rc = system "./testbootstrap",
217 "-env:ININAME=./bootstraptest.ini",
218 '-env:MYBOOTSTRAPTESTVALUE=${$ININAME:${$ININAME:SecondSection:IndirectSection}:${$ININAME:SecondSection:IndirectKey}}';
220 $comment = $comment . "profile access with complex macro expansion test not passed\n";
224 # test no infinit recursion
225 if ($ENV{GUI
} eq "WNT") {
226 $rc = system "./testbootstrap",
227 '"***RECURSION DETECTED***"',
228 '-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
231 $rc = system "./testbootstrap",
232 '***RECURSION DETECTED***',
233 '-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
236 $comment = $comment . "no infinit recursion test not passed\n";
241 $rc = system "./testbootstrap",
243 '-env:MYBOOTSTRAPTESTVALUE=\u0041\u0041\u0041\u0042\u0042\u0042\u0043\u0043\u0043\u0030\u0030\u0030';
245 $comment = $comment . "uncode not passed\n";
249 print "**************************\n";
251 print "****** tests passed ******\n";
254 print "**** tests NOT passed ****\n";
255 print "Commnent:\n", $comment, "\n";
257 print "**************************\n";