xref: /aoo42x/main/sal/test/bootstrap (revision 86e1cf34)
1 #/bin/tcsh
2 # *************************************************************
3 #
4 #  Licensed to the Apache Software Foundation (ASF) under one
5 #  or more contributor license agreements.  See the NOTICE file
6 #  distributed with this work for additional information
7 #  regarding copyright ownership.  The ASF licenses this file
8 #  to you under the Apache License, Version 2.0 (the
9 #  "License"); you may not use this file except in compliance
10 #  with the License.  You may obtain a copy of the License at
11 #
12 #    http://www.apache.org/licenses/LICENSE-2.0
13 #
14 #  Unless required by applicable law or agreed to in writing,
15 #  software distributed under the License is distributed on an
16 #  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 #  KIND, either express or implied.  See the License for the
18 #  specific language governing permissions and limitations
19 #  under the License.
20 #
21 # *************************************************************
22 
23 setenv MYBOOTSTRAPTESTVALUE 0
24 echo 1
25 ./testbootstrap 1 -env:MYBOOTSTRAPTESTVALUE=1
26 
27 echo 2
28 ./testbootstrap.bin file
29 
30 echo 3
31 ./testbootstrap.Bin file
32 
33 echo 4
34 ./testbootstrap.exe file
35 
36 echo 5
37 ./testbootstrap.Exe file
38 
39 echo 6
40 ./testbootstrap 0 -env:INIFILENAME=
41 
42 unsetenv MYBOOTSTRAPTESTVALUE
43 echo 7
44 ./testbootstrap default -env:INIFILENAME=
45 
46 echo 8
47 ./testbootstrap default -env:MYBOOTSTRAPTESTVALUE2=1 -env:INIFILENAME=
48 
49 echo
50 echo "macro tests"
51 echo
52 
53 # simple macro expansion
54 echo 9
55 ./testbootstrap _first_second_third_ -env:FIRST=first -env:SECOND=second -env:THIRD=third -env:MYBOOTSTRAPTESTVALUE='_${FIRST}_${SECOND}_${THIRD}_'
56 
57 # simple quoting
58 echo 10
59 ./testbootstrap '_${FIRST}_${SECOND}_${THIRD}_' -env:FIRST=first -env:SECOND=second -env:THIRD=third -env:MYBOOTSTRAPTESTVALUE='_\$\{FIRST\}_\$\{SECOND\}_\$\{THIRD\}_'
60 
61 # simple ini access
62 echo 11
63 ./testbootstrap TheKeysValue -env:'MYBOOTSTRAPTESTVALUE=${./bootstraptest.ini:TheSection:TheKey}'
64 
65 # ini access with simple macro expansion
66 echo 12
67 ./testbootstrap TheKeysValue -env:ININAME=./bootstraptest.ini -env:SECTIONNAME=TheSection -env:KEYNAME=TheKey \
68 	 -env:'MYBOOTSTRAPTESTVALUE=${$ININAME:$SECTIONNAME:$KEYNAME}'
69 
70 # ini access with complex macro expansion
71 echo 13
72 ./testbootstrap TheKeysValue -env:ININAME=./bootstraptest.ini \
73 	-env:'MYBOOTSTRAPTESTVALUE=${$ININAME:${$ININAME:SecondSection:IndirectSection}:${$ININAME:SecondSection:IndirectKey}}'
74 
75 # test no infinite recursion
76 echo 14
77 ./testbootstrap "***RECURSION DETECTED***" -env:'MYBOOTSTRAPTESTVALUE=$MYBOOTSTRAPTESTVALUE'
78 
79 # test unicode
80 echo 15
81 ./testbootstrap AAABBBCCC000 -env:'MYBOOTSTRAPTESTVALUE=\u0041\u0041\u0041\u0042\u0042\u0042\u0043\u0043\u0043\u0030\u0030\u0030'
82 
83 echo
84 echo "bootstrap test finished"
85 echo
86