Commit 92cbc9e0 authored by Zolnierczuk, Piotr's avatar Zolnierczuk, Piotr
Browse files

testing improvements

- added automatic test for drspine program [tests/testsdrpine.sh]
  and associated data

- added helper script to build DrSPINE on the SNS cluster
  (will only work there)
parent 9528ecfa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
* devel ------- (May 1, 2020)
- [PZ] internal improvements (testing)

* version 1.0.9 (Apr 9, 2020)
- [MM] updates to bgr subtraction

+7 −2
Original line number Diff line number Diff line
@@ -3,10 +3,15 @@ INSTALL=install
-include ../Makefile.def
-include ../Makefile.version

# TODO: the last two scripts only work at SNS
SCRIPTS=\
	drspine_activate.sh  \
	drspine_create_env.sh\
	drspine_create_env.sh

ifeq ($(INSTRUMENT),1)
SCRIPTS+=build_drspine_sns.sh \
	     nse_copy_ipts.sh
endif

all:	;

+87 −0
Original line number Diff line number Diff line
#!/bin/bash

# ===============================================================
# Script to automake DrSPINE installation on the SNS cluster
# ===============================================================
argv0=`basename $0`

# setup
NSETOPDIR=/SNS/software/nse
export PATH=$NSETOPDIR/anaconda/bin:$NSETOPDIR/bin:$PATH
export TEXMFHOME=$NSETOPDIR/share/texmf


cleanup=0
install=0
verbose=0

logger()
{
   if [ $verbose -eq 0 ]; then return; fi
   echo $*
}

usage()
{
    if test ! -z "$1"; then echo "$argv0: $1"; fi
    echo "usage: $argv0  [options]" 
    echo "options: "
    echo "         -c    : clean"
    echo "         -i    : install"
    echo "         -v    : verbose"
    echo "         -h    : this help"
}
temp=`getopt -n argv0 -- civh $*`
if [ $? -ne 0 ]; then usage; exit -1; fi
eval set -- "$temp"
while true; do
    case "$1" in
	-c)
            cleanup=1
            shift  ;;
	-i)
            install=1
            shift  ;;
        -v)
	    verbose=1
            shift ;;
        -h)
            usage
            exit 0;
            shift   ;;
        --)
            shift
            break   ;;
        *)
            echo "getopt internal error"; exit 1;;
    esac
done




CURVER=`drspine -V|awk '{print $2}'|cut -f1 -d-`
echo "DrSPINE current version: " $CURVER


if [ $cleanup -ne 0 ]; then
	logger "make -ks distclean"
	make -ks distclean
fi

logger "copying Makefile.def"
cp -p $NSETOPDIR/share/misc/Makefile.drspine.def Makefile.def

logger "make -ks all"
make -ks all

if [ $install -ne 0 ]; then
    # make a backup of the current version of drspine
	logger "making a backup copy $NSETOPDIR/bin/drspine-${CURVER}"
	cp -p $NSETOPDIR/bin/drspine $NSETOPDIR/bin/drspine-${CURVER}

    # install software
	logger "make install DESTDIR=$NSETOPDIR"
	make install DESTDIR=$NSETOPDIR
fi
+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@ Short description of the test programs in the tests directory
User driven test programs
-------------------------

# testdrspine.sh
Run drspine tests and compares it with "version 1.0" results

# testbins
Test TOF binnings.

tests/macro_test

0 → 100644
+31 −0
Original line number Diff line number Diff line
macro

! ==== macro to run automatic test of drspine
! ==== using IPTS-11737 (MK) data

! ==== set binning
bins pix nbins 8
bins tof custom 2 13 26 39

! ==== set histogramming
set A  1e-10
set ns 1e-9

histo tau  nbins 20 min 0.002*ns max 200.0*ns log
histo q    nbins 20 min 0.000/A  max 0.5/A    

c ==== read data
read s5848.echo s5849.echo s5850.echo s5851.echo s5852.echo s5853.echo as resolution
read s5854.echo s5855.echo s5857.echo s5858.echo s5859.echo s58600.echo as sample

c === process

match all
fit   all
collect

c === done
quit


Loading