Skip to content

Commit

Permalink
pycbc_test_suite to be able to run from anywhere within the git repo (g…
Browse files Browse the repository at this point in the history
…wastro#4774)

* make it so that pycbc_test_suite will run from anywhere within the git repo

* Stop using git, change directory to the base in the script
  • Loading branch information
GarethCabournDavies authored Aug 5, 2024
1 parent c0b798e commit 1c6ad7e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/pycbc_test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ echo -e "\\n>> [`date`] Python Major Version:" $PYTHON_VERSION
PYTHON_MINOR_VERSION=`python -c 'import sys; print(sys.version_info.minor)'`
echo -e "\\n>> [`date`] Python Minor Version:" $PYTHON_MINOR_VERSION

# This will work from anywhere within the pycbc directory
this_script_dir=`dirname -- "$( readlink -f -- "$0"; )"`
cd $this_script_dir
cd ..

LOG_FILE=$(mktemp -t pycbc-test-log.XXXXXXXXXX)

RESULT=0
Expand All @@ -29,7 +34,8 @@ function test_result {
if [ "$PYCBC_TEST_TYPE" = "unittest" ] || [ -z ${PYCBC_TEST_TYPE+x} ]; then
for prog in `find test -name '*.py' -print | egrep -v '(long|lalsim|test_waveform)'`
do
echo -e ">> [`date`] running unit test for $prog"
prog_short=`echo $prog | rev | cut -d"/" -f1 | rev`
echo -e ">> [`date`] running unit test for $prog_short"
python $prog &> $LOG_FILE
test_result
done
Expand Down

0 comments on commit 1c6ad7e

Please sign in to comment.