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