diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
commit | db20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch) | |
tree | e5435159cd1bf0519276363a6fe1663d1721bed3 /tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh | |
parent | 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff) | |
download | coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2 coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip |
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh')
-rw-r--r-- | tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh b/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh new file mode 100644 index 0000000000..38834ed6a5 --- /dev/null +++ b/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +function print_usage { + echo '' + echo 'Usage:' + echo '[rt=<runtime_path>] [nc=<nuget_cache_path>] [cli=<cli_path>] where:' + echo ' <runtime_path>: path to the runtime that you want to use for testing.' + echo ' <nuget_cache_path>: path to the nuget cache.' + echo ' <cli_path>: path to the cli tool.' + echo '' + echo '' +} + +# Argument variables +__RuntimeRoot='$(TestRoot)\Runtimes\Coreclr1' +__NugetCacheDir='$(WorkingDir)\packages' +__CliPath= +__ConfigFileName='Debugger.Tests.Config.txt' +__TemplateFileName='ConfigTemplate.txt' + +for i in "$@" +do + case $i in + -h|--help) + print_usage + exit $EXIT_CODE_SUCCESS + ;; + rt=*) + __RuntimeRoot=${i#*=} + ;; + nc=*) + __NugetCacheDir=${i#*=} + ;; + cli=*) + __CliPath=${i#*=} + ;; + *) + echo "Unknown switch: $i" + print_usage + exit $EXIT_CODE_SUCCESS + ;; + esac +done + +if ! -e "$__TemplateFileName" +then + echo '$__TemplateFileName does not exist' + exit 1 +fi + +if -e "$__ConfigFileName" +then + rm "$__ConfigFileName" +fi + +cp "$__TemplateFileName" "$__ConfigFileName" + +sed -i \ + 's/##Insert_Runtime_Root##/$__RuntimeRoot/g;' \ + 's/##Insert_Nuget_Cache_Root##/$__NugetCacheDir/g'\ + 's/##Cli_Path##/$__CliPath/g'\ + 's/corerun.exe/corerun/g'\ + "$__ConfigFileName" + +exit 0
\ No newline at end of file |