<commit_before>#!/bin/bash
BUILD_DIR=${BUILD_DIR:=$HOME/raven_libs/build}
INSTALL_DIR=${INSTALL_DIR:=$HOME/raven_libs/pylibs}
PYTHON_CMD=${PYTHON_CMD:=python}
JOBS=${JOBS:=1}
mkdir -p $BUILD_DIR
mkdir -p $INSTALL_DIR
DOWNLOADER='curl -C - -L -O '
SCRIPT_DIRNAME=`dirname $0`
SCRIPT_DIR=`(cd $SCRIPT_DIRNAME; pwd)`

ORIGPYTHONPATH="$PYTHONPATH"

update_python_path ()
{
    if ls -d $INSTALL_DIR/*/python*/site-packages/
    then
        export PYTHONPATH=`ls -d $INSTALL_DIR/*/python*/site-packages/`:"$ORIGPYTHONPATH"
    fi
}

update_python_path
PATH=$INSTALL_DIR/bin:$PATH


if which coverage
then
    echo coverage already available, skipping building it.
else
    if curl http://www.energy.gov > /dev/null
    then
       echo Successfully got data from the internet
    else
       echo Could not connect to internet
    fi

    cd $BUILD_DIR
    $DOWNLOADER https://pypi.python.org/packages/source/c/coverage/coverage-3.7.1.tar.gz #md5=67d4e393f4c6a5ffc18605409d2aa1ac
    tar -xvzf coverage-3.7.1.tar.gz
    cd coverage-3.7.1
    (unset CC CXX; $PYTHON_CMD setup.py install --prefix=$INSTALL_DIR)
fi

update_python_path

cd $SCRIPT_DIR

EXTRA='--rcfile=.coveragerc --source=../../framework -a --omit=../../framework/contrib/pyDOE/*'
cd tests/framework
#coverage help run


coverage erase
#skip test_rom_trainer.xml
for I in test_simple.xml test_output.xml test_branch.xml test_preconditioned_det.xml test_push_into_hdf5.xml test_rom_trainer_no_normalization.xml test_rom_train_from_already_dumped_HDF5.xml test_FullFactorial_Sampler.xml test_ResponseSurfaceDesign_Sampler.xml test_Grid_Sampler.xml test_random.xml test_LHS_Sampler.xml test_Grid_Sampler_Bison.xml test_LHS_Sampler_Bison.xml test_LHS_Sampler_Raven.xml test_Grid_Sampler_Raven.xml test_Lorentz.xml test_BasicStatistics.xml test_LimitSurface.xml test_CreateInternalObjFromCSVs.xml test_bison_mc_simple.xml test_custom_mode.xml test_iostep_load.xml test_safest_point.xml test_safest_point_cdf.xml test_externalPostProcessor.xml test_adaptive_det_simple.xml test_external_reseed.xml test_stoch_poly.xml test_io_ROM_pickle.xml test_relap5_code_interface.xml
do
    echo Running $I
    coverage run $EXTRA ../../framework/Driver.py  $I
done
coverage run $EXTRA ../../framework/TestDistributions.py
coverage html
<commit_msg>check_py_coverage changed. when we want to run a test case checking the codeInterface Only, the keyword interfacecheck needs to be passed as command line argument<commit_after>#!/bin/bash
BUILD_DIR=${BUILD_DIR:=$HOME/raven_libs/build}
INSTALL_DIR=${INSTALL_DIR:=$HOME/raven_libs/pylibs}
PYTHON_CMD=${PYTHON_CMD:=python}
JOBS=${JOBS:=1}
mkdir -p $BUILD_DIR
mkdir -p $INSTALL_DIR
DOWNLOADER='curl -C - -L -O '
SCRIPT_DIRNAME=`dirname $0`
SCRIPT_DIR=`(cd $SCRIPT_DIRNAME; pwd)`

ORIGPYTHONPATH="$PYTHONPATH"

update_python_path ()
{
    if ls -d $INSTALL_DIR/*/python*/site-packages/
    then
        export PYTHONPATH=`ls -d $INSTALL_DIR/*/python*/site-packages/`:"$ORIGPYTHONPATH"
    fi
}

update_python_path
PATH=$INSTALL_DIR/bin:$PATH


if which coverage
then
    echo coverage already available, skipping building it.
else
    if curl http://www.energy.gov > /dev/null
    then
       echo Successfully got data from the internet
    else
       echo Could not connect to internet
    fi

    cd $BUILD_DIR
    $DOWNLOADER https://pypi.python.org/packages/source/c/coverage/coverage-3.7.1.tar.gz #md5=67d4e393f4c6a5ffc18605409d2aa1ac
    tar -xvzf coverage-3.7.1.tar.gz
    cd coverage-3.7.1
    (unset CC CXX; $PYTHON_CMD setup.py install --prefix=$INSTALL_DIR)
fi

update_python_path

cd $SCRIPT_DIR

EXTRA='--rcfile=.coveragerc --source=../../framework -a --omit=../../framework/contrib/pyDOE/*'
cd tests/framework
#coverage help run


coverage erase
#skip test_rom_trainer.xml
for I in test_simple.xml test_output.xml test_branch.xml test_preconditioned_det.xml test_push_into_hdf5.xml test_rom_trainer_no_normalization.xml test_rom_train_from_already_dumped_HDF5.xml test_FullFactorial_Sampler.xml test_ResponseSurfaceDesign_Sampler.xml test_Grid_Sampler.xml test_random.xml test_LHS_Sampler.xml test_Grid_Sampler_Bison.xml test_LHS_Sampler_Bison.xml test_LHS_Sampler_Raven.xml test_Grid_Sampler_Raven.xml test_Lorentz.xml test_BasicStatistics.xml test_LimitSurface.xml test_CreateInternalObjFromCSVs.xml test_bison_mc_simple.xml test_custom_mode.xml test_iostep_load.xml test_safest_point.xml test_safest_point_cdf.xml test_externalPostProcessor.xml test_adaptive_det_simple.xml test_external_reseed.xml test_stoch_poly.xml test_io_ROM_pickle.xml test_relap5_code_interface.xml
do
    echo Running $I
    coverage run $EXTRA ../../framework/Driver.py  $I
done
coverage run $EXTRA ../../framework/TestDistributions.py
coverage run $EXTRA ../../framework/Driver.py test_relap5_code_interface.xml interfacecheck
coverage html

{'fraction_non_alphanumeric': 0.09786439975119221, 'fraction_numerical': 0.01430644826871242, 'mean_word_length': 5.022471910112359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 65}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5589819', 'n_tokens_mistral': 1825, 'n_tokens_neox': 1727, 'n_words': 330}