<commit_before>#!/usr/bin/env bash
set -x
#
# Constants
#
readonly EXIT_CODE_SUCCESS=0

#
# This script should be located in coreclr/tests.
#

function print_usage {
    echo ''
    echo 'Download coredistool for GC stress testing'
    echo ''
    echo 'Command line:'
    echo ''
    echo './setup-gcstress.sh --outputDir=<coredistools_lib_install_path>'
    echo ''
    echo 'Required arguments:'
    echo '  --outputDir=<path>         : Directory to install libcoredistools.so'
    echo ''
}

# temorary directory 
tmpDirPath=

function exit_with_error {
    local errorCode=$1
    local errorMsg=$2

    if [ ! -z "$2" ]; then
        echo $2
    fi
    
    if [ -e $tmpDirPath ]; then
        rm -rf $tmpDirPath
    fi
    
    exit $errorCode
}

function handle_ctrl_c {
    exit_with_error 1 'Aborted by Ctrl+C'
 }

# Register the Ctrl-C handler
trap handle_ctrl_c INT

# Argument variables
libInstallDir=

# Handle arguments
verbose=0
for i in "$@"
do
    case $i in
        -h|--help)
            exit $EXIT_CODE_SUCCESS
            ;;
        -v|--verbose)
            verbose=1
            ;;
        --outputDir=*)
            libInstallDir=${i#*=}
            ;;
        *)
            echo "Unknown switch: $i"
            print_usage
            exit $EXIT_CODE_SUCCESS
            ;;
    esac
done

if [ -z "$libInstallDir" ]; then
    echo "--libInstallDir is required."
    print_usage
    exit_with_error 1
fi

# create temp directory
tmpDirPath=`mktemp -d`
if [ ! -e $tmpDirPath ]; then
    exit_with_error 1 "Cannot create a temporary directory"
fi

# This script must be located in coreclr/tests.
scriptDir=$(cd "$(dirname "$0")"; pwd -P)
dotnetToolsDir=$scriptDir/../Tools
dotnetCmd=${dotnetToolsDir}/dotnetcli/dotnet
packageDir=${scriptDir}/../packages
jsonFilePath=${tmpDirPath}/project.json

# Check tool directory
if [ ! -e $dotnetToolsDir ]; then
    exit_with_error 1 'Directory containing dotnet commandline does not exist:'$dotnetToolsDir 
fi
if [ ! -e $dotnetCmd ]; then
    exit_with_error 1 'donet commandline does not exist:'$dotnetCmd
fi

# make package directory
if [ ! -e $packageDir ]; then<commit_msg>Remove set -x from tests/setup-runtime-dependencies.sh.<commit_after>#!/usr/bin/env bash
# set -x

#
# Constants
#
readonly EXIT_CODE_SUCCESS=0

#
# This script should be located in coreclr/tests.
#

function print_usage {
    echo ''
    echo 'Download coredistools for GC stress testing'
    echo ''
    echo 'Command line:'
    echo ''
    echo './setup-gcstress.sh --outputDir=<coredistools_lib_install_path>'
    echo ''
    echo 'Required arguments:'
    echo '  --outputDir=<path>         : Directory to install libcoredistools.so'
    echo ''
}

# temorary directory 
tmpDirPath=

function exit_with_error {
    local errorCode=$1
    local errorMsg=$2

    if [ ! -z "$2" ]; then
        echo $2
    fi
    
    if [ -e $tmpDirPath ]; then
        rm -rf $tmpDirPath
    fi
    
    exit $errorCode
}

function handle_ctrl_c {
    exit_with_error 1 'Aborted by Ctrl+C'
 }

# Register the Ctrl-C handler
trap handle_ctrl_c INT

# Argument variables
libInstallDir=

# Handle arguments
verbose=0
for i in "$@"
do
    case $i in
        -h|--help)
            exit $EXIT_CODE_SUCCESS
            ;;
        -v|--verbose)
            verbose=1
            ;;
        --outputDir=*)
            libInstallDir=${i#*=}
            ;;
        *)
            echo "Unknown switch: $i"
            print_usage
            exit $EXIT_CODE_SUCCESS
            ;;
    esac
done

if [ -z "$libInstallDir" ]; then
    echo "--libInstallDir is required."
    print_usage
    exit_with_error 1
fi

# create temp directory
tmpDirPath=`mktemp -d`
if [ ! -e $tmpDirPath ]; then
    exit_with_error 1 "Cannot create a temporary directory"
fi

# This script must be located in coreclr/tests.
scriptDir=$(cd "$(dirname "$0")"; pwd -P)
dotnetToolsDir=$scriptDir/../Tools
dotnetCmd=${dotnetToolsDir}/dotnetcli/dotnet
packageDir=${scriptDir}/../packages
jsonFilePath=${tmpDirPath}/project.json

# Check tool directory
if [ ! -e $dotnetToolsDir ]; then
    exit_with_error 1 'Directory containing dotnet commandline does not exist:'$dotnetToolsDir 
fi
if [ ! -e $dotnetCmd ]; then
    exit_with_error 1 'dotnet commandline does not exist:'$dotnetCmd
fi

# make package directory
if [ ! -e $packageDir ]; then
{'fraction_non_alphanumeric': 0.10967444008312167, 'fraction_numerical': 0.006003232509812976, 'mean_word_length': 2.553732567678425, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5983634', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1389, 'n_words': 391}