1cdf0e10cSrcweir#/bin/tcsh 2*b31e36b3SAndrew Rist# ************************************************************* 3*b31e36b3SAndrew Rist# 4*b31e36b3SAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 5*b31e36b3SAndrew Rist# or more contributor license agreements. See the NOTICE file 6*b31e36b3SAndrew Rist# distributed with this work for additional information 7*b31e36b3SAndrew Rist# regarding copyright ownership. The ASF licenses this file 8*b31e36b3SAndrew Rist# to you under the Apache License, Version 2.0 (the 9*b31e36b3SAndrew Rist# "License"); you may not use this file except in compliance 10*b31e36b3SAndrew Rist# with the License. You may obtain a copy of the License at 11*b31e36b3SAndrew Rist# 12*b31e36b3SAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 13*b31e36b3SAndrew Rist# 14*b31e36b3SAndrew Rist# Unless required by applicable law or agreed to in writing, 15*b31e36b3SAndrew Rist# software distributed under the License is distributed on an 16*b31e36b3SAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17*b31e36b3SAndrew Rist# KIND, either express or implied. See the License for the 18*b31e36b3SAndrew Rist# specific language governing permissions and limitations 19*b31e36b3SAndrew Rist# under the License. 20*b31e36b3SAndrew Rist# 21*b31e36b3SAndrew 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 75cdf0e10cSrcweir# test no infinit 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