"Fossies" - the Fresh Open Source Software Archive

Member "detox-1.4.5/tests/test.sh" (15 Aug 2021, 641 Bytes) of package /linux/privat/detox-1.4.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test.sh": 1.4.4_vs_1.4.5.

    1 #!/usr/bin/env bash
    2 #
    3 # Executes all unit tests
    4 #
    5 
    6 if [ -z $1 ] ; then
    7     echo missing detox path
    8     exit 1
    9 fi
   10 
   11 . $(dirname "$0")/test-functions
   12 
   13 DETOX=$(realpath $1)
   14 if [ ! -x $DETOX ] ; then
   15     echo cannot find detox at $1
   16     exit 1
   17 fi
   18 
   19 cd $(dirname $0)
   20 
   21 export TESTBASE=$(pwd)
   22 
   23 SUCCESS=1
   24 
   25 for DIR in tests/* ; do
   26     echo "------------------------------------------------------"
   27     echo running test $(basename $DIR)
   28     cd $DIR
   29     ./test.sh $DETOX
   30     if [ $? -ne 0 ] ; then
   31         SUCCESS=0
   32         echo FAILED
   33     fi
   34     cd $TESTBASE
   35 done
   36 
   37 echo "------------------------------------------------------"
   38 if [ $SUCCESS -ne 1 ] ; then
   39     echo one or more tests failed
   40     exit 1
   41 fi