2 eval 'exec perl -wS $0 ${1+"$@"}'
5 # This file is part of the LibreOffice project.
7 # This Source Code Form is subject to the terms of the Mozilla Public
8 # License, v. 2.0. If a copy of the MPL was not distributed with this
9 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 # This file incorporates work covered by the following license notice:
13 # Licensed to the Apache Software Foundation (ASF) under one or more
14 # contributor license agreements. See the NOTICE file distributed
15 # with this work for additional information regarding copyright
16 # ownership. The ASF licenses this file to you under the Apache
17 # License, Version 2.0 (the "License"); you may not use this file
18 # except in compliance with the License. You may obtain a copy of
19 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
27 $ENV{MYBOOTSTRAPTESTVALUE
}=0;
29 $rc = system "./testbootstrap", 1, "-env:MYBOOTSTRAPTESTVALUE=1";
31 $comment = $comment . "commandline over environment test not passed\n";
35 $rc = system "./testbootstrap", "0", "-env:INIFILENAME=";
37 $comment = $comment . "exe custom ini test not passed\n";
41 delete $ENV{MYBOOTSTRAPTESTVALUE
};
43 $rc = system "./testbootstrap.bin", "file";
45 $comment = $comment . "extensions cut test not passed with .bin\n";
49 $rc = system "./testbootstrap.Bin", "file";
51 $comment = $comment . "extensions cut test not passed with .Bin\n";
55 $rc = system "./testbootstrap.exe", "file";
57 $comment = $comment . "extensions cut test not passed with .exe\n";
61 $rc = system "./testbootstrap.Exe", "file";
63 $comment = $comment . "extensions cut test not passed with .Exe\n";
67 if ($ENV{OS
} eq "WNT") {
68 $rc = system "./testbootstrap", "auxaux", "-env:iniName=ini.ini", '-env:MYBOOTSTRAPTESTVALUE=$CUSTOMINIVALUE';
71 $rc = system "./testbootstrap", "auxaux", "-env:iniName=inirc", '-env:MYBOOTSTRAPTESTVALUE=$CUSTOMINIVALUE';
74 $comment = $comment . "custom ini test not passed\n";
78 if ($ENV{OS
} eq "WNT") {
79 $comment = $comment . '$SYSUSERHOME not testable under windows' . "\n";
82 $rc = system "./testbootstrap", "file://$ENV{HOME}", '-env:MYBOOTSTRAPTESTVALUE=$SYSUSERHOME';
84 $comment = $comment . '$SYSUSERHOME test not passed' . "\n";
89 if ($ENV{OS
} eq "WNT") {
90 $comment = $comment . '$SYSUSERCONFIG' . " not testable under windows\n";
93 $rc = system "./testbootstrap", "file://$ENV{HOME}", '-env:MYBOOTSTRAPTESTVALUE=$SYSUSERCONFIG';
95 $comment = $comment . '$SYSUSERCONFIG test not passed' . "\n";
100 if ($ENV{OS
} eq "WNT") {
101 $comment = $comment . '$SYSBINDIR' . " not testable under windows\n";
104 $rc = system "./testbootstrap", "file://$ENV{PWD}", '-env:MYBOOTSTRAPTESTVALUE=$SYSBINDIR';
106 $comment = $comment . '$SYSBINDIR test not passed' . "\n";
111 if ($ENV{OS
} eq "WNT") {
112 $rc = system "./testbootstrap", "inherited_value", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_VALUE', "-env:iniName=ini.ini";
115 $rc = system "./testbootstrap", "inherited_value", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_VALUE', "-env:iniName=inirc";
118 $comment = $comment . "inherited value not passed\n";
122 if ($ENV{OS
} eq "WNT") {
123 $rc = system "./testbootstrap", "not_overwritten", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_OVERWRITTEN_VALUE', "-env:iniName=ini.ini";
126 $rc = system "./testbootstrap", "not_overwritten", '-env:MYBOOTSTRAPTESTVALUE=$INHERITED_OVERWRITTEN_VALUE', "-env:iniName=inirc";
129 $comment = $comment . "inherited overwritten value not passed\n";
134 $rc = system "./testbootstrap", "defaultvalue", "-env:INIFILENAME=", "-env:Default=defaultvalue", "-env:USEDEFAULT=1";
136 $comment = $comment . "default test from parameter not passed\n";
140 if ($ENV{OS
} eq "WNT") {
141 $rc = system "./testbootstrap", "defaultValue", "-env:iniName=default.ini", "-env:INIFILENAME=", "-env:USEDEFAULT=1";
144 $rc = system "./testbootstrap", "defaultValue", "-env:iniName=defaultrc", "-env:INIFILENAME=", "-env:USEDEFAULT=1";
147 $comment = $comment . "default test from custom ini not passed\n";
151 # simple macro expansion
152 $rc = system "./testbootstrap",
153 "_first_second_third_",
155 "-env:SECOND=second",
157 '-env:MYBOOTSTRAPTESTVALUE=_${FIRST}_${SECOND}_${THIRD}_';
159 $comment = $comment . "simple macro expansion test not passed\n";
164 $rc = system "./testbootstrap",
165 '_${FIRST}_${SECOND}_${THIRD}_',
167 "-env:SECOND=second",
169 '-env:MYBOOTSTRAPTESTVALUE=_\$\{FIRST\}_\$\{SECOND\}_\$\{THIRD\}_';
171 $comment = $comment . "simple macro quoting test not passed\n";
176 $rc = system "./testbootstrap",
178 '-env:MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheIniKey}';
180 $comment = $comment . "simple macro ini access test not passed\n";
184 # simple profile access
185 $rc = system "./testbootstrap",
187 '-env:MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheSection:TheKey}';
189 $comment = $comment . "simple macro profile access test not passed\n";
193 # profile access with simple macro expansion
194 $rc = system "./testbootstrap",
196 "-env:ININAME=./bootstraptest.ini",
197 "-env:SECTIONNAME=TheSection",
198 "-env:KEYNAME=TheKey",
199 '-env:MYBOOTSTRAPTESTVALUE=${$ININAME:$SECTIONNAME:$KEYNAME}';
201 $comment = $comment . "profile access with simple macro expansion test not passed\n";
205 # profile access with complex macro expansion
206 $rc = system "./testbootstrap",
208 "-env:ININAME=./bootstraptest.ini",
209 '-env:MYBOOTSTRAPTESTVALUE=${$ININAME:${$ININAME:SecondSection:IndirectSection}:${$ININAME:SecondSection:IndirectKey}}';
211 $comment = $comment . "profile access with complex macro expansion test not passed\n";
215 # test no infinite recursion
216 if ($ENV{OS
} eq "WNT") {
217 $rc = system "./testbootstrap",
218 '"***RECURSION DETECTED***"',
219 '-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
222 $rc = system "./testbootstrap",
223 '***RECURSION DETECTED***',
224 '-env:MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE';
227 $comment = $comment . "no infinite recursion test not passed\n";
232 $rc = system "./testbootstrap",
234 '-env:MYBOOTSTRAPTESTVALUE=\u0041\u0041\u0041\u0042\u0042\u0042\u0043\u0043\u0043\u0030\u0030\u0030';
236 $comment = $comment . "unicode not passed\n";
240 print "**************************\n";
242 print "****** tests passed ******\n";
245 print "**** tests NOT passed ****\n";
246 print "Comment:\n", $comment, "\n";
248 print "**************************\n";